; 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.14 = external hidden unnamed_addr constant [32 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 void @png_set_filter_heuristics(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %5
  store i32 1, ptr %12, align 4
  br label %281

16:                                               ; preds = %5
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = icmp sge i32 %17, 3
  br i1 %18, label %19, label %21

19:                                               ; preds = %16
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  call void @png_warning(ptr noundef %20, ptr noundef @.str.14)
  store i32 1, ptr %12, align 4
  br label %281

21:                                               ; preds = %16
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %24, %21
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %34, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %34, label %31

31:                                               ; preds = %28
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %31, %28, %25
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %34, %31
  %36 = load i32, ptr %8, align 4, !tbaa !9
  %37 = trunc i32 %36 to i8
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 103
  store i8 %37, ptr %39, align 1, !tbaa !11
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = trunc i32 %40 to i8
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 102
  store i8 %41, ptr %43, align 8, !tbaa !21
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %179

46:                                               ; preds = %35
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.png_struct_def, ptr %47, i32 0, i32 104
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %76

51:                                               ; preds = %46
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = mul i64 1, %54
  %56 = trunc i64 %55 to i32
  %57 = zext i32 %56 to i64
  %58 = call ptr @png_malloc(ptr noundef %52, i64 noundef %57)
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 104
  store ptr %58, ptr %60, align 8, !tbaa !22
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %72, %51
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %75

65:                                               ; preds = %61
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.png_struct_def, ptr %66, i32 0, i32 104
  %68 = load ptr, ptr %67, align 8, !tbaa !22
  %69 = load i32, ptr %11, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i8, ptr %68, i64 %70
  store i8 -1, ptr %71, align 1, !tbaa !23
  br label %72

72:                                               ; preds = %65
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %11, align 4, !tbaa !9
  br label %61, !llvm.loop !24

75:                                               ; preds = %61
  br label %76

76:                                               ; preds = %75, %46
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_struct_def, ptr %77, i32 0, i32 105
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  %80 = icmp eq ptr %79, null
  br i1 %80, label %81, label %121

81:                                               ; preds = %76
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = mul i64 2, %84
  %86 = trunc i64 %85 to i32
  %87 = zext i32 %86 to i64
  %88 = call ptr @png_malloc(ptr noundef %82, i64 noundef %87)
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 105
  store ptr %88, ptr %90, align 8, !tbaa !26
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = mul i64 2, %93
  %95 = trunc i64 %94 to i32
  %96 = zext i32 %95 to i64
  %97 = call ptr @png_malloc(ptr noundef %91, i64 noundef %96)
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 106
  store ptr %97, ptr %99, align 8, !tbaa !27
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %117, %81
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = load i32, ptr %8, align 4, !tbaa !9
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %120

104:                                              ; preds = %100
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 105
  %107 = load ptr, ptr %106, align 8, !tbaa !26
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i16, ptr %107, i64 %109
  store i16 256, ptr %110, align 2, !tbaa !28
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_struct_def, ptr %111, i32 0, i32 106
  %113 = load ptr, ptr %112, align 8, !tbaa !27
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i16, ptr %113, i64 %115
  store i16 256, ptr %116, align 2, !tbaa !28
  br label %117

117:                                              ; preds = %104
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %11, align 4, !tbaa !9
  br label %100, !llvm.loop !29

120:                                              ; preds = %100
  br label %121

121:                                              ; preds = %120, %76
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %175, %121
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %126, label %178

126:                                              ; preds = %122
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !30
  %132 = fcmp olt double %131, 0.000000e+00
  br i1 %132, label %133, label %146

133:                                              ; preds = %126
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 105
  %136 = load ptr, ptr %135, align 8, !tbaa !26
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i16, ptr %136, i64 %138
  store i16 256, ptr %139, align 2, !tbaa !28
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 106
  %142 = load ptr, ptr %141, align 8, !tbaa !27
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i16, ptr %142, i64 %144
  store i16 256, ptr %145, align 2, !tbaa !28
  br label %174

146:                                              ; preds = %126
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds double, ptr %147, i64 %149
  %151 = load double, ptr %150, align 8, !tbaa !30
  %152 = call double @llvm.fmuladd.f64(double 2.560000e+02, double %151, double 5.000000e-01)
  %153 = fptoui double %152 to i16
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_struct_def, ptr %154, i32 0, i32 106
  %156 = load ptr, ptr %155, align 8, !tbaa !27
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i16, ptr %156, i64 %158
  store i16 %153, ptr %159, align 2, !tbaa !28
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = load i32, ptr %11, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds double, ptr %160, i64 %162
  %164 = load double, ptr %163, align 8, !tbaa !30
  %165 = fdiv double 2.560000e+02, %164
  %166 = fadd double %165, 5.000000e-01
  %167 = fptoui double %166 to i16
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.png_struct_def, ptr %168, i32 0, i32 105
  %170 = load ptr, ptr %169, align 8, !tbaa !26
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i16, ptr %170, i64 %172
  store i16 %167, ptr %173, align 2, !tbaa !28
  br label %174

174:                                              ; preds = %146, %133
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %11, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %11, align 4, !tbaa !9
  br label %122, !llvm.loop !32

178:                                              ; preds = %122
  br label %179

179:                                              ; preds = %178, %35
  %180 = load ptr, ptr %6, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.png_struct_def, ptr %180, i32 0, i32 107
  %182 = load ptr, ptr %181, align 8, !tbaa !33
  %183 = icmp eq ptr %182, null
  br i1 %183, label %184, label %213

184:                                              ; preds = %179
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = call ptr @png_malloc(ptr noundef %185, i64 noundef 10)
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.png_struct_def, ptr %187, i32 0, i32 107
  store ptr %186, ptr %188, align 8, !tbaa !33
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = call ptr @png_malloc(ptr noundef %189, i64 noundef 10)
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.png_struct_def, ptr %191, i32 0, i32 108
  store ptr %190, ptr %192, align 8, !tbaa !34
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %209, %184
  %194 = load i32, ptr %11, align 4, !tbaa !9
  %195 = icmp slt i32 %194, 5
  br i1 %195, label %196, label %212

196:                                              ; preds = %193
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.png_struct_def, ptr %197, i32 0, i32 107
  %199 = load ptr, ptr %198, align 8, !tbaa !33
  %200 = load i32, ptr %11, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i16, ptr %199, i64 %201
  store i16 8, ptr %202, align 2, !tbaa !28
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 108
  %205 = load ptr, ptr %204, align 8, !tbaa !34
  %206 = load i32, ptr %11, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i16, ptr %205, i64 %207
  store i16 8, ptr %208, align 2, !tbaa !28
  br label %209

209:                                              ; preds = %196
  %210 = load i32, ptr %11, align 4, !tbaa !9
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %11, align 4, !tbaa !9
  br label %193, !llvm.loop !35

212:                                              ; preds = %193
  br label %213

213:                                              ; preds = %212, %179
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %214

214:                                              ; preds = %277, %213
  %215 = load i32, ptr %11, align 4, !tbaa !9
  %216 = icmp slt i32 %215, 5
  br i1 %216, label %217, label %280

217:                                              ; preds = %214
  %218 = load ptr, ptr %10, align 8, !tbaa !5
  %219 = icmp eq ptr %218, null
  br i1 %219, label %227, label %220

220:                                              ; preds = %217
  %221 = load ptr, ptr %10, align 8, !tbaa !5
  %222 = load i32, ptr %11, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds double, ptr %221, i64 %223
  %225 = load double, ptr %224, align 8, !tbaa !30
  %226 = fcmp olt double %225, 0.000000e+00
  br i1 %226, label %227, label %240

227:                                              ; preds = %220, %217
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.png_struct_def, ptr %228, i32 0, i32 107
  %230 = load ptr, ptr %229, align 8, !tbaa !33
  %231 = load i32, ptr %11, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i16, ptr %230, i64 %232
  store i16 8, ptr %233, align 2, !tbaa !28
  %234 = load ptr, ptr %6, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.png_struct_def, ptr %234, i32 0, i32 108
  %236 = load ptr, ptr %235, align 8, !tbaa !34
  %237 = load i32, ptr %11, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds i16, ptr %236, i64 %238
  store i16 8, ptr %239, align 2, !tbaa !28
  br label %276

240:                                              ; preds = %220
  %241 = load ptr, ptr %10, align 8, !tbaa !5
  %242 = load i32, ptr %11, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds double, ptr %241, i64 %243
  %245 = load double, ptr %244, align 8, !tbaa !30
  %246 = fcmp oge double %245, 1.000000e+00
  br i1 %246, label %247, label %275

247:                                              ; preds = %240
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = load i32, ptr %11, align 4, !tbaa !9
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds double, ptr %248, i64 %250
  %252 = load double, ptr %251, align 8, !tbaa !30
  %253 = fdiv double 8.000000e+00, %252
  %254 = fadd double %253, 5.000000e-01
  %255 = fptoui double %254 to i16
  %256 = load ptr, ptr %6, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.png_struct_def, ptr %256, i32 0, i32 108
  %258 = load ptr, ptr %257, align 8, !tbaa !34
  %259 = load i32, ptr %11, align 4, !tbaa !9
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds i16, ptr %258, i64 %260
  store i16 %255, ptr %261, align 2, !tbaa !28
  %262 = load ptr, ptr %10, align 8, !tbaa !5
  %263 = load i32, ptr %11, align 4, !tbaa !9
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds double, ptr %262, i64 %264
  %266 = load double, ptr %265, align 8, !tbaa !30
  %267 = call double @llvm.fmuladd.f64(double 8.000000e+00, double %266, double 5.000000e-01)
  %268 = fptoui double %267 to i16
  %269 = load ptr, ptr %6, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.png_struct_def, ptr %269, i32 0, i32 107
  %271 = load ptr, ptr %270, align 8, !tbaa !33
  %272 = load i32, ptr %11, align 4, !tbaa !9
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds i16, ptr %271, i64 %273
  store i16 %268, ptr %274, align 2, !tbaa !28
  br label %275

275:                                              ; preds = %247, %240
  br label %276

276:                                              ; preds = %275, %227
  br label %277

277:                                              ; preds = %276
  %278 = load i32, ptr %11, align 4, !tbaa !9
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %11, align 4, !tbaa !9
  br label %214, !llvm.loop !36

280:                                              ; preds = %214
  store i32 0, ptr %12, align 4
  br label %281

281:                                              ; preds = %280, %19, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %282 = load i32, ptr %12, align 4
  switch i32 %282, label %284 [
    i32 0, label %283
    i32 1, label %283
  ]

283:                                              ; preds = %281, %281
  ret void

284:                                              ; preds = %281
  unreachable
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 929}
!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, !7, i64 928}
!22 = !{!12, !6, i64 936}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !6, i64 944}
!27 = !{!12, !6, i64 952}
!28 = !{!16, !16, i64 0}
!29 = distinct !{!29, !25}
!30 = !{!31, !31, i64 0}
!31 = !{!"double", !7, i64 0}
!32 = distinct !{!32, !25}
!33 = !{!12, !6, i64 960}
!34 = !{!12, !6, i64 968}
!35 = distinct !{!35, !25}
!36 = distinct !{!36, !25}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_set_filter_heuristics(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef readonly %3, ptr noundef readonly %4) local_unnamed_addr #1 {
  %6 = icmp eq ptr %0, null
  br i1 %6, label %.loopexit, label %7

7:                                                ; preds = %5
  %8 = icmp sgt i32 %1, 2
  br i1 %8, label %9, label %10

9:                                                ; preds = %7
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.14) #4
  br label %.loopexit

10:                                               ; preds = %7
  %spec.store.select = tail call i32 @llvm.umax.i32(i32 %1, i32 1)
  %11 = icmp slt i32 %2, 0
  %12 = icmp eq ptr %3, null
  %or.cond = or i1 %11, %12
  %13 = icmp ult i32 %1, 2
  %or.cond3 = or i1 %13, %or.cond
  %spec.store.select4 = select i1 %or.cond3, i32 0, i32 %2
  %14 = trunc i32 %spec.store.select4 to i8
  %15 = getelementptr inbounds i8, ptr %0, i64 929
  store i8 %14, ptr %15, align 1, !tbaa !5
  %16 = trunc i32 %spec.store.select to i8
  %17 = getelementptr inbounds i8, ptr %0, i64 928
  store i8 %16, ptr %17, align 8, !tbaa !19
  %.not = icmp eq i32 %spec.store.select4, 0
  br i1 %.not, label %.loopexit91, label %18

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %0, i64 936
  %20 = load ptr, ptr %19, align 8, !tbaa !20
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %.loopexit93

22:                                               ; preds = %18
  %23 = zext nneg i32 %spec.store.select4 to i64
  %24 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %23) #4
  store ptr %24, ptr %19, align 8, !tbaa !20
  %xtraiter = and i64 %23, 3
  %25 = icmp ult i32 %spec.store.select4, 4
  br i1 %25, label %.loopexit93.loopexit.unr-lcssa, label %.new

.new:                                             ; preds = %22
  %unroll_iter = and i64 %23, 2147483644
  br label %26

26:                                               ; preds = %26, %.new
  %indvars.iv = phi i64 [ 0, %.new ], [ %indvars.iv.next.3, %26 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %26 ]
  %27 = load ptr, ptr %19, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %27, i64 %indvars.iv
  store i8 -1, ptr %28, align 1, !tbaa !21
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %29 = load ptr, ptr %19, align 8, !tbaa !20
  %30 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv.next
  store i8 -1, ptr %30, align 1, !tbaa !21
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %31 = load ptr, ptr %19, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv.next.1
  store i8 -1, ptr %32, align 1, !tbaa !21
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %33 = load ptr, ptr %19, align 8, !tbaa !20
  %34 = getelementptr inbounds i8, ptr %33, i64 %indvars.iv.next.2
  store i8 -1, ptr %34, align 1, !tbaa !21
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.loopexit93.loopexit.unr-lcssa, label %26, !llvm.loop !22

.loopexit93.loopexit.unr-lcssa:                   ; preds = %26, %22
  %indvars.iv.unr = phi i64 [ 0, %22 ], [ %indvars.iv.next.3, %26 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit93, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit93.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %.loopexit93.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit93.loopexit.unr-lcssa ]
  %35 = load ptr, ptr %19, align 8, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %35, i64 %indvars.iv.epil
  store i8 -1, ptr %36, align 1, !tbaa !21
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.loopexit93, label %.epil.preheader, !llvm.loop !24

.loopexit93:                                      ; preds = %.loopexit93.loopexit.unr-lcssa, %.epil.preheader, %18
  %37 = getelementptr inbounds i8, ptr %0, i64 944
  %38 = load ptr, ptr %37, align 8, !tbaa !26
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %.loopexit93..loopexit92_crit_edge

.loopexit93..loopexit92_crit_edge:                ; preds = %.loopexit93
  %.pre = tail call i32 @llvm.umax.i32(i32 %spec.store.select4, i32 1)
  %.pre124 = zext nneg i32 %.pre to i64
  br label %.loopexit92

40:                                               ; preds = %.loopexit93
  %41 = shl nuw i32 %spec.store.select4, 1
  %42 = zext i32 %41 to i64
  %43 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %42) #4
  store ptr %43, ptr %37, align 8, !tbaa !26
  %44 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %42) #4
  %45 = getelementptr inbounds i8, ptr %0, i64 952
  store ptr %44, ptr %45, align 8, !tbaa !27
  %46 = load ptr, ptr %37, align 8, !tbaa !26
  %umax = tail call i32 @llvm.umax.i32(i32 %spec.store.select4, i32 1)
  %wide.trip.count104 = zext nneg i32 %umax to i64
  %min.iters.check = icmp ult i32 %spec.store.select4, 16
  %47 = ptrtoint ptr %46 to i64
  %48 = ptrtoint ptr %44 to i64
  %49 = sub i64 %48, %47
  %diff.check = icmp ult i64 %49, 32
  %or.cond138 = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond138, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %40
  %n.vec = and i64 %wide.trip.count104, 2147483632
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %50 = getelementptr inbounds i16, ptr %46, i64 %index
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  store <8 x i16> <i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256>, ptr %50, align 2, !tbaa !28
  store <8 x i16> <i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256>, ptr %51, align 2, !tbaa !28
  %52 = getelementptr inbounds i16, ptr %44, i64 %index
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store <8 x i16> <i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256>, ptr %52, align 2, !tbaa !28
  store <8 x i16> <i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256, i16 256>, ptr %53, align 2, !tbaa !28
  %index.next = add nuw i64 %index, 16
  %54 = icmp eq i64 %index.next, %n.vec
  br i1 %54, label %middle.block, label %vector.body, !llvm.loop !29

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count104
  br i1 %cmp.n, label %.loopexit92, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %40
  %indvars.iv101.ph = phi i64 [ 0, %40 ], [ %n.vec, %middle.block ]
  %xtraiter139 = and i64 %wide.trip.count104, 3
  %lcmp.mod140.not = icmp eq i64 %xtraiter139, 0
  br i1 %lcmp.mod140.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv101.prol = phi i64 [ %indvars.iv.next102.prol, %scalar.ph.prol ], [ %indvars.iv101.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %55 = getelementptr inbounds i16, ptr %46, i64 %indvars.iv101.prol
  store i16 256, ptr %55, align 2, !tbaa !28
  %56 = getelementptr inbounds i16, ptr %44, i64 %indvars.iv101.prol
  store i16 256, ptr %56, align 2, !tbaa !28
  %indvars.iv.next102.prol = add nuw nsw i64 %indvars.iv101.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter139
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !32

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv101.unr = phi i64 [ %indvars.iv101.ph, %scalar.ph.preheader ], [ %indvars.iv.next102.prol, %scalar.ph.prol ]
  %57 = sub nsw i64 %indvars.iv101.ph, %wide.trip.count104
  %58 = icmp ugt i64 %57, -4
  br i1 %58, label %.loopexit92, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv101 = phi i64 [ %indvars.iv.next102.3, %scalar.ph ], [ %indvars.iv101.unr, %scalar.ph.prol.loopexit ]
  %59 = getelementptr inbounds i16, ptr %46, i64 %indvars.iv101
  store i16 256, ptr %59, align 2, !tbaa !28
  %60 = getelementptr inbounds i16, ptr %44, i64 %indvars.iv101
  store i16 256, ptr %60, align 2, !tbaa !28
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %61 = getelementptr inbounds i16, ptr %46, i64 %indvars.iv.next102
  store i16 256, ptr %61, align 2, !tbaa !28
  %62 = getelementptr inbounds i16, ptr %44, i64 %indvars.iv.next102
  store i16 256, ptr %62, align 2, !tbaa !28
  %indvars.iv.next102.1 = add nuw nsw i64 %indvars.iv101, 2
  %63 = getelementptr inbounds i16, ptr %46, i64 %indvars.iv.next102.1
  store i16 256, ptr %63, align 2, !tbaa !28
  %64 = getelementptr inbounds i16, ptr %44, i64 %indvars.iv.next102.1
  store i16 256, ptr %64, align 2, !tbaa !28
  %indvars.iv.next102.2 = add nuw nsw i64 %indvars.iv101, 3
  %65 = getelementptr inbounds i16, ptr %46, i64 %indvars.iv.next102.2
  store i16 256, ptr %65, align 2, !tbaa !28
  %66 = getelementptr inbounds i16, ptr %44, i64 %indvars.iv.next102.2
  store i16 256, ptr %66, align 2, !tbaa !28
  %indvars.iv.next102.3 = add nuw nsw i64 %indvars.iv101, 4
  %exitcond105.not.3 = icmp eq i64 %indvars.iv.next102.3, %wide.trip.count104
  br i1 %exitcond105.not.3, label %.loopexit92, label %scalar.ph, !llvm.loop !33

.loopexit92:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %.loopexit93..loopexit92_crit_edge
  %wide.trip.count110.pre-phi = phi i64 [ %.pre124, %.loopexit93..loopexit92_crit_edge ], [ %wide.trip.count104, %middle.block ], [ %wide.trip.count104, %scalar.ph ], [ %wide.trip.count104, %scalar.ph.prol.loopexit ]
  %67 = phi ptr [ %38, %.loopexit93..loopexit92_crit_edge ], [ %46, %middle.block ], [ %46, %scalar.ph ], [ %46, %scalar.ph.prol.loopexit ]
  %68 = getelementptr inbounds i8, ptr %0, i64 952
  br label %69

69:                                               ; preds = %.loopexit92, %84
  %indvars.iv106 = phi i64 [ 0, %.loopexit92 ], [ %indvars.iv.next107, %84 ]
  %70 = getelementptr inbounds double, ptr %3, i64 %indvars.iv106
  %71 = load double, ptr %70, align 8, !tbaa !34
  %72 = fcmp olt double %71, 0.000000e+00
  br i1 %72, label %73, label %76

73:                                               ; preds = %69
  %74 = getelementptr inbounds i16, ptr %67, i64 %indvars.iv106
  store i16 256, ptr %74, align 2, !tbaa !28
  %75 = load ptr, ptr %68, align 8, !tbaa !27
  br label %84

76:                                               ; preds = %69
  %77 = tail call double @llvm.fmuladd.f64(double %71, double 2.560000e+02, double 5.000000e-01)
  %78 = fptoui double %77 to i16
  %79 = load ptr, ptr %68, align 8, !tbaa !27
  %80 = getelementptr inbounds i16, ptr %79, i64 %indvars.iv106
  store i16 %78, ptr %80, align 2, !tbaa !28
  %81 = fdiv double 2.560000e+02, %71
  %82 = fadd double %81, 5.000000e-01
  %83 = fptoui double %82 to i16
  br label %84

84:                                               ; preds = %73, %76
  %.sink126 = phi ptr [ %75, %73 ], [ %67, %76 ]
  %.sink = phi i16 [ 256, %73 ], [ %83, %76 ]
  %85 = getelementptr inbounds i16, ptr %.sink126, i64 %indvars.iv106
  store i16 %.sink, ptr %85, align 2, !tbaa !28
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count110.pre-phi
  br i1 %exitcond111.not, label %.loopexit91, label %69, !llvm.loop !36

.loopexit91:                                      ; preds = %84, %10
  %86 = getelementptr inbounds i8, ptr %0, i64 960
  %87 = load ptr, ptr %86, align 8, !tbaa !37
  %88 = icmp eq ptr %87, null
  br i1 %88, label %.loopexit90.loopexit, label %.loopexit90

.loopexit90.loopexit:                             ; preds = %.loopexit91
  %89 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef 10) #4
  store ptr %89, ptr %86, align 8, !tbaa !37
  %90 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef 10) #4
  %91 = getelementptr inbounds i8, ptr %0, i64 968
  store ptr %90, ptr %91, align 8, !tbaa !38
  %92 = load ptr, ptr %86, align 8, !tbaa !37
  store i16 8, ptr %92, align 2, !tbaa !28
  store i16 8, ptr %90, align 2, !tbaa !28
  %93 = getelementptr inbounds i8, ptr %92, i64 2
  store i16 8, ptr %93, align 2, !tbaa !28
  %94 = getelementptr inbounds i8, ptr %90, i64 2
  store i16 8, ptr %94, align 2, !tbaa !28
  %95 = getelementptr inbounds i8, ptr %92, i64 4
  store i16 8, ptr %95, align 2, !tbaa !28
  %96 = getelementptr inbounds i8, ptr %90, i64 4
  store i16 8, ptr %96, align 2, !tbaa !28
  %97 = getelementptr inbounds i8, ptr %92, i64 6
  store i16 8, ptr %97, align 2, !tbaa !28
  %98 = getelementptr inbounds i8, ptr %90, i64 6
  store i16 8, ptr %98, align 2, !tbaa !28
  %99 = getelementptr inbounds i8, ptr %92, i64 8
  store i16 8, ptr %99, align 2, !tbaa !28
  %100 = getelementptr inbounds i8, ptr %90, i64 8
  store i16 8, ptr %100, align 2, !tbaa !28
  br label %.loopexit90

.loopexit90:                                      ; preds = %.loopexit90.loopexit, %.loopexit91
  %101 = phi ptr [ %92, %.loopexit90.loopexit ], [ %87, %.loopexit91 ]
  %102 = icmp eq ptr %4, null
  %103 = getelementptr inbounds i8, ptr %0, i64 968
  br i1 %102, label %.split.us, label %.split.preheader

.split.preheader:                                 ; preds = %.loopexit90
  %104 = load double, ptr %4, align 8, !tbaa !34
  %105 = fcmp olt double %104, 0.000000e+00
  br i1 %105, label %115, label %117

.split.us:                                        ; preds = %.loopexit90
  %106 = load ptr, ptr %103, align 8, !tbaa !38
  store i16 8, ptr %101, align 2, !tbaa !28
  store i16 8, ptr %106, align 2, !tbaa !28
  %107 = getelementptr inbounds i8, ptr %101, i64 2
  store i16 8, ptr %107, align 2, !tbaa !28
  %108 = getelementptr inbounds i8, ptr %106, i64 2
  store i16 8, ptr %108, align 2, !tbaa !28
  %109 = getelementptr inbounds i8, ptr %101, i64 4
  store i16 8, ptr %109, align 2, !tbaa !28
  %110 = getelementptr inbounds i8, ptr %106, i64 4
  store i16 8, ptr %110, align 2, !tbaa !28
  %111 = getelementptr inbounds i8, ptr %101, i64 6
  store i16 8, ptr %111, align 2, !tbaa !28
  %112 = getelementptr inbounds i8, ptr %106, i64 6
  store i16 8, ptr %112, align 2, !tbaa !28
  %113 = getelementptr inbounds i8, ptr %101, i64 8
  store i16 8, ptr %113, align 2, !tbaa !28
  %114 = getelementptr inbounds i8, ptr %106, i64 8
  store i16 8, ptr %114, align 2, !tbaa !28
  br label %.loopexit

115:                                              ; preds = %.split.preheader
  store i16 8, ptr %101, align 2, !tbaa !28
  %116 = load ptr, ptr %103, align 8, !tbaa !38
  store i16 8, ptr %116, align 2, !tbaa !28
  br label %.split.1

117:                                              ; preds = %.split.preheader
  %118 = fcmp ult double %104, 1.000000e+00
  br i1 %118, label %.split.1, label %119

119:                                              ; preds = %117
  %120 = fdiv double 8.000000e+00, %104
  %121 = fadd double %120, 5.000000e-01
  %122 = fptoui double %121 to i16
  %123 = load ptr, ptr %103, align 8, !tbaa !38
  store i16 %122, ptr %123, align 2, !tbaa !28
  %124 = tail call double @llvm.fmuladd.f64(double %104, double 8.000000e+00, double 5.000000e-01)
  %125 = fptoui double %124 to i16
  store i16 %125, ptr %101, align 2, !tbaa !28
  br label %.split.1

.split.1:                                         ; preds = %115, %119, %117
  %126 = getelementptr inbounds i8, ptr %4, i64 8
  %127 = load double, ptr %126, align 8, !tbaa !34
  %128 = fcmp olt double %127, 0.000000e+00
  br i1 %128, label %139, label %129

129:                                              ; preds = %.split.1
  %130 = fcmp ult double %127, 1.000000e+00
  br i1 %130, label %.split.2, label %131

131:                                              ; preds = %129
  %132 = fdiv double 8.000000e+00, %127
  %133 = fadd double %132, 5.000000e-01
  %134 = fptoui double %133 to i16
  %135 = load ptr, ptr %103, align 8, !tbaa !38
  %136 = getelementptr inbounds i8, ptr %135, i64 2
  store i16 %134, ptr %136, align 2, !tbaa !28
  %137 = tail call double @llvm.fmuladd.f64(double %127, double 8.000000e+00, double 5.000000e-01)
  %138 = fptoui double %137 to i16
  br label %.split.2.sink.split

139:                                              ; preds = %.split.1
  %140 = getelementptr inbounds i8, ptr %101, i64 2
  store i16 8, ptr %140, align 2, !tbaa !28
  %141 = load ptr, ptr %103, align 8, !tbaa !38
  br label %.split.2.sink.split

.split.2.sink.split:                              ; preds = %131, %139
  %.sink129 = phi ptr [ %141, %139 ], [ %101, %131 ]
  %.sink127 = phi i16 [ 8, %139 ], [ %138, %131 ]
  %142 = getelementptr inbounds i8, ptr %.sink129, i64 2
  store i16 %.sink127, ptr %142, align 2, !tbaa !28
  br label %.split.2

.split.2:                                         ; preds = %.split.2.sink.split, %129
  %143 = getelementptr inbounds i8, ptr %4, i64 16
  %144 = load double, ptr %143, align 8, !tbaa !34
  %145 = fcmp olt double %144, 0.000000e+00
  br i1 %145, label %156, label %146

146:                                              ; preds = %.split.2
  %147 = fcmp ult double %144, 1.000000e+00
  br i1 %147, label %.split.3, label %148

148:                                              ; preds = %146
  %149 = fdiv double 8.000000e+00, %144
  %150 = fadd double %149, 5.000000e-01
  %151 = fptoui double %150 to i16
  %152 = load ptr, ptr %103, align 8, !tbaa !38
  %153 = getelementptr inbounds i8, ptr %152, i64 4
  store i16 %151, ptr %153, align 2, !tbaa !28
  %154 = tail call double @llvm.fmuladd.f64(double %144, double 8.000000e+00, double 5.000000e-01)
  %155 = fptoui double %154 to i16
  br label %.split.3.sink.split

156:                                              ; preds = %.split.2
  %157 = getelementptr inbounds i8, ptr %101, i64 4
  store i16 8, ptr %157, align 2, !tbaa !28
  %158 = load ptr, ptr %103, align 8, !tbaa !38
  br label %.split.3.sink.split

.split.3.sink.split:                              ; preds = %148, %156
  %.sink132 = phi ptr [ %158, %156 ], [ %101, %148 ]
  %.sink130 = phi i16 [ 8, %156 ], [ %155, %148 ]
  %159 = getelementptr inbounds i8, ptr %.sink132, i64 4
  store i16 %.sink130, ptr %159, align 2, !tbaa !28
  br label %.split.3

.split.3:                                         ; preds = %.split.3.sink.split, %146
  %160 = getelementptr inbounds i8, ptr %4, i64 24
  %161 = load double, ptr %160, align 8, !tbaa !34
  %162 = fcmp olt double %161, 0.000000e+00
  br i1 %162, label %173, label %163

163:                                              ; preds = %.split.3
  %164 = fcmp ult double %161, 1.000000e+00
  br i1 %164, label %.split.4, label %165

165:                                              ; preds = %163
  %166 = fdiv double 8.000000e+00, %161
  %167 = fadd double %166, 5.000000e-01
  %168 = fptoui double %167 to i16
  %169 = load ptr, ptr %103, align 8, !tbaa !38
  %170 = getelementptr inbounds i8, ptr %169, i64 6
  store i16 %168, ptr %170, align 2, !tbaa !28
  %171 = tail call double @llvm.fmuladd.f64(double %161, double 8.000000e+00, double 5.000000e-01)
  %172 = fptoui double %171 to i16
  br label %.split.4.sink.split

173:                                              ; preds = %.split.3
  %174 = getelementptr inbounds i8, ptr %101, i64 6
  store i16 8, ptr %174, align 2, !tbaa !28
  %175 = load ptr, ptr %103, align 8, !tbaa !38
  br label %.split.4.sink.split

.split.4.sink.split:                              ; preds = %165, %173
  %.sink135 = phi ptr [ %175, %173 ], [ %101, %165 ]
  %.sink133 = phi i16 [ 8, %173 ], [ %172, %165 ]
  %176 = getelementptr inbounds i8, ptr %.sink135, i64 6
  store i16 %.sink133, ptr %176, align 2, !tbaa !28
  br label %.split.4

.split.4:                                         ; preds = %.split.4.sink.split, %163
  %177 = getelementptr inbounds i8, ptr %4, i64 32
  %178 = load double, ptr %177, align 8, !tbaa !34
  %179 = fcmp olt double %178, 0.000000e+00
  br i1 %179, label %191, label %180

180:                                              ; preds = %.split.4
  %181 = fcmp ult double %178, 1.000000e+00
  br i1 %181, label %.loopexit, label %182

182:                                              ; preds = %180
  %183 = fdiv double 8.000000e+00, %178
  %184 = fadd double %183, 5.000000e-01
  %185 = fptoui double %184 to i16
  %186 = load ptr, ptr %103, align 8, !tbaa !38
  %187 = getelementptr inbounds i8, ptr %186, i64 8
  store i16 %185, ptr %187, align 2, !tbaa !28
  %188 = tail call double @llvm.fmuladd.f64(double %178, double 8.000000e+00, double 5.000000e-01)
  %189 = fptoui double %188 to i16
  %190 = getelementptr inbounds i8, ptr %101, i64 8
  store i16 %189, ptr %190, align 2, !tbaa !28
  br label %.loopexit

191:                                              ; preds = %.split.4
  %192 = getelementptr inbounds i8, ptr %101, i64 8
  store i16 8, ptr %192, align 2, !tbaa !28
  %193 = load ptr, ptr %103, align 8, !tbaa !38
  %194 = getelementptr inbounds i8, ptr %193, i64 8
  store i16 8, ptr %194, align 2, !tbaa !28
  br label %.loopexit

.loopexit:                                        ; preds = %180, %182, %191, %.split.us, %5, %9
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

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

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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 929}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, 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, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, 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, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !12, i64 16, !7, i64 24}
!19 = !{!6, !7, i64 928}
!20 = !{!6, !9, i64 936}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = !{!6, !9, i64 944}
!27 = !{!6, !9, i64 952}
!28 = !{!14, !14, i64 0}
!29 = distinct !{!29, !23, !30, !31}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !25}
!33 = distinct !{!33, !23, !30}
!34 = !{!35, !35, i64 0}
!35 = !{!"double", !7, i64 0}
!36 = distinct !{!36, !23}
!37 = !{!6, !9, i64 960}
!38 = !{!6, !9, i64 968}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass