; LLVM IR from arasgungore/filters-and-fractals :: main (adjustBlur)

; 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.PPMPixel = type { i8, i8, i8 }
%struct.PPMImage = type { i32, i32, ptr }

@BLACK = external dso_local constant %struct.PPMPixel, 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

; Function Attrs: nounwind uwtable
declare dso_local ptr @createPPMImage(i32 noundef, i32 noundef, i24) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @copyPPMImage(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @adjustBlur(ptr noundef %0, double noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i24, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store double %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.PPMImage, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.PPMImage, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 1 @BLACK, i64 3, i1 false)
  %26 = load i24, ptr %6, align 4
  %27 = call ptr @createPPMImage(i32 noundef %22, i32 noundef %25, i24 %26)
  store ptr %27, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %28 = load double, ptr %4, align 8, !tbaa !9
  %29 = fmul double %28, 2.570000e+00
  %30 = call double @llvm.ceil.f64(double %29)
  %31 = fptosi double %30 to i32
  store i32 %31, ptr %7, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %10, align 4, !tbaa !15
  br label %32

32:                                               ; preds = %284, %2
  %33 = load i32, ptr %10, align 4, !tbaa !15
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PPMImage, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = icmp slt i32 %33, %36
  br i1 %37, label %38, label %287

38:                                               ; preds = %32
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %39

39:                                               ; preds = %280, %38
  %40 = load i32, ptr %11, align 4, !tbaa !15
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.PPMImage, ptr %41, i32 0, i32 0
  %43 = load i32, ptr %42, align 8, !tbaa !11
  %44 = icmp slt i32 %40, %43
  br i1 %44, label %45, label %283

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store double 0.000000e+00, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store double 0.000000e+00, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 0.000000e+00, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store double 0.000000e+00, ptr %15, align 8, !tbaa !9
  %46 = load i32, ptr %10, align 4, !tbaa !15
  %47 = load i32, ptr %7, align 4, !tbaa !15
  %48 = sub nsw i32 %46, %47
  store i32 %48, ptr %9, align 4, !tbaa !15
  br label %49

49:                                               ; preds = %222, %45
  %50 = load i32, ptr %9, align 4, !tbaa !15
  %51 = load i32, ptr %10, align 4, !tbaa !15
  %52 = load i32, ptr %7, align 4, !tbaa !15
  %53 = add nsw i32 %51, %52
  %54 = add nsw i32 %53, 1
  %55 = icmp slt i32 %50, %54
  br i1 %55, label %56, label %225

56:                                               ; preds = %49
  %57 = load i32, ptr %11, align 4, !tbaa !15
  %58 = load i32, ptr %7, align 4, !tbaa !15
  %59 = sub nsw i32 %57, %58
  store i32 %59, ptr %8, align 4, !tbaa !15
  br label %60

60:                                               ; preds = %218, %56
  %61 = load i32, ptr %8, align 4, !tbaa !15
  %62 = load i32, ptr %11, align 4, !tbaa !15
  %63 = load i32, ptr %7, align 4, !tbaa !15
  %64 = add nsw i32 %62, %63
  %65 = add nsw i32 %64, 1
  %66 = icmp slt i32 %61, %65
  br i1 %66, label %67, label %221

67:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %68 = load i32, ptr %8, align 4, !tbaa !15
  %69 = icmp slt i32 0, %68
  br i1 %69, label %70, label %86

70:                                               ; preds = %67
  %71 = load i32, ptr %8, align 4, !tbaa !15
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.PPMImage, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !11
  %75 = sub nsw i32 %74, 1
  %76 = icmp slt i32 %71, %75
  br i1 %76, label %77, label %79

77:                                               ; preds = %70
  %78 = load i32, ptr %8, align 4, !tbaa !15
  br label %84

79:                                               ; preds = %70
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.PPMImage, ptr %80, i32 0, i32 0
  %82 = load i32, ptr %81, align 8, !tbaa !11
  %83 = sub nsw i32 %82, 1
  br label %84

84:                                               ; preds = %79, %77
  %85 = phi i32 [ %78, %77 ], [ %83, %79 ]
  br label %100

86:                                               ; preds = %67
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.PPMImage, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !11
  %90 = sub i32 %89, 1
  %91 = icmp ult i32 0, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  br label %98

93:                                               ; preds = %86
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.PPMImage, ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !11
  %97 = sub nsw i32 %96, 1
  br label %98

98:                                               ; preds = %93, %92
  %99 = phi i32 [ 0, %92 ], [ %97, %93 ]
  br label %100

100:                                              ; preds = %98, %84
  %101 = phi i32 [ %85, %84 ], [ %99, %98 ]
  store i32 %101, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %102 = load i32, ptr %9, align 4, !tbaa !15
  %103 = icmp slt i32 0, %102
  br i1 %103, label %104, label %120

104:                                              ; preds = %100
  %105 = load i32, ptr %9, align 4, !tbaa !15
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.PPMImage, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !14
  %109 = sub nsw i32 %108, 1
  %110 = icmp slt i32 %105, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %104
  %112 = load i32, ptr %9, align 4, !tbaa !15
  br label %118

113:                                              ; preds = %104
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.PPMImage, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !14
  %117 = sub nsw i32 %116, 1
  br label %118

118:                                              ; preds = %113, %111
  %119 = phi i32 [ %112, %111 ], [ %117, %113 ]
  br label %134

120:                                              ; preds = %100
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.PPMImage, ptr %121, i32 0, i32 1
  %123 = load i32, ptr %122, align 4, !tbaa !14
  %124 = sub i32 %123, 1
  %125 = icmp ult i32 0, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %120
  br label %132

127:                                              ; preds = %120
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.PPMImage, ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !14
  %131 = sub nsw i32 %130, 1
  br label %132

132:                                              ; preds = %127, %126
  %133 = phi i32 [ 0, %126 ], [ %131, %127 ]
  br label %134

134:                                              ; preds = %132, %118
  %135 = phi i32 [ %119, %118 ], [ %133, %132 ]
  store i32 %135, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %136 = load i32, ptr %8, align 4, !tbaa !15
  %137 = load i32, ptr %11, align 4, !tbaa !15
  %138 = sub nsw i32 %136, %137
  %139 = sitofp i32 %138 to double
  %140 = call double @pow(double noundef %139, double noundef 2.000000e+00) #5
  %141 = load i32, ptr %9, align 4, !tbaa !15
  %142 = load i32, ptr %10, align 4, !tbaa !15
  %143 = sub nsw i32 %141, %142
  %144 = sitofp i32 %143 to double
  %145 = call double @pow(double noundef %144, double noundef 2.000000e+00) #5
  %146 = fadd double %140, %145
  store double %146, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %147 = load double, ptr %18, align 8, !tbaa !9
  %148 = fneg double %147
  %149 = load double, ptr %4, align 8, !tbaa !9
  %150 = call double @pow(double noundef %149, double noundef 2.000000e+00) #5
  %151 = fmul double 2.000000e+00, %150
  %152 = fdiv double %148, %151
  %153 = call double @exp(double noundef %152) #5
  %154 = load double, ptr %4, align 8, !tbaa !9
  %155 = call double @pow(double noundef %154, double noundef 2.000000e+00) #5
  %156 = fmul double 0x401921FB54442D18, %155
  %157 = fdiv double %153, %156
  store double %157, ptr %19, align 8, !tbaa !9
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.PPMImage, ptr %158, i32 0, i32 2
  %160 = load ptr, ptr %159, align 8, !tbaa !16
  %161 = load i32, ptr %16, align 4, !tbaa !15
  %162 = load i32, ptr %17, align 4, !tbaa !15
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.PPMImage, ptr %163, i32 0, i32 0
  %165 = load i32, ptr %164, align 8, !tbaa !11
  %166 = mul i32 %162, %165
  %167 = add i32 %161, %166
  %168 = zext i32 %167 to i64
  %169 = getelementptr inbounds %struct.PPMPixel, ptr %160, i64 %168
  %170 = getelementptr inbounds %struct.PPMPixel, ptr %169, i32 0, i32 0
  %171 = load i8, ptr %170, align 1, !tbaa !17
  %172 = zext i8 %171 to i32
  %173 = sitofp i32 %172 to double
  %174 = load double, ptr %19, align 8, !tbaa !9
  %175 = load double, ptr %12, align 8, !tbaa !9
  %176 = call double @llvm.fmuladd.f64(double %173, double %174, double %175)
  store double %176, ptr %12, align 8, !tbaa !9
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.PPMImage, ptr %177, i32 0, i32 2
  %179 = load ptr, ptr %178, align 8, !tbaa !16
  %180 = load i32, ptr %16, align 4, !tbaa !15
  %181 = load i32, ptr %17, align 4, !tbaa !15
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.PPMImage, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !11
  %185 = mul i32 %181, %184
  %186 = add i32 %180, %185
  %187 = zext i32 %186 to i64
  %188 = getelementptr inbounds %struct.PPMPixel, ptr %179, i64 %187
  %189 = getelementptr inbounds %struct.PPMPixel, ptr %188, i32 0, i32 1
  %190 = load i8, ptr %189, align 1, !tbaa !19
  %191 = zext i8 %190 to i32
  %192 = sitofp i32 %191 to double
  %193 = load double, ptr %19, align 8, !tbaa !9
  %194 = load double, ptr %13, align 8, !tbaa !9
  %195 = call double @llvm.fmuladd.f64(double %192, double %193, double %194)
  store double %195, ptr %13, align 8, !tbaa !9
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.PPMImage, ptr %196, i32 0, i32 2
  %198 = load ptr, ptr %197, align 8, !tbaa !16
  %199 = load i32, ptr %16, align 4, !tbaa !15
  %200 = load i32, ptr %17, align 4, !tbaa !15
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.PPMImage, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !11
  %204 = mul i32 %200, %203
  %205 = add i32 %199, %204
  %206 = zext i32 %205 to i64
  %207 = getelementptr inbounds %struct.PPMPixel, ptr %198, i64 %206
  %208 = getelementptr inbounds %struct.PPMPixel, ptr %207, i32 0, i32 2
  %209 = load i8, ptr %208, align 1, !tbaa !20
  %210 = zext i8 %209 to i32
  %211 = sitofp i32 %210 to double
  %212 = load double, ptr %19, align 8, !tbaa !9
  %213 = load double, ptr %14, align 8, !tbaa !9
  %214 = call double @llvm.fmuladd.f64(double %211, double %212, double %213)
  store double %214, ptr %14, align 8, !tbaa !9
  %215 = load double, ptr %19, align 8, !tbaa !9
  %216 = load double, ptr %15, align 8, !tbaa !9
  %217 = fadd double %216, %215
  store double %217, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %218

218:                                              ; preds = %134
  %219 = load i32, ptr %8, align 4, !tbaa !15
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %8, align 4, !tbaa !15
  br label %60, !llvm.loop !21

221:                                              ; preds = %60
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %9, align 4, !tbaa !15
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %9, align 4, !tbaa !15
  br label %49, !llvm.loop !23

225:                                              ; preds = %49
  %226 = load double, ptr %12, align 8, !tbaa !9
  %227 = load double, ptr %15, align 8, !tbaa !9
  %228 = fdiv double %226, %227
  %229 = call double @llvm.round.f64(double %228)
  %230 = fptoui double %229 to i8
  %231 = load ptr, ptr %5, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.PPMImage, ptr %231, i32 0, i32 2
  %233 = load ptr, ptr %232, align 8, !tbaa !16
  %234 = load i32, ptr %11, align 4, !tbaa !15
  %235 = load i32, ptr %10, align 4, !tbaa !15
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.PPMImage, ptr %236, i32 0, i32 0
  %238 = load i32, ptr %237, align 8, !tbaa !11
  %239 = mul i32 %235, %238
  %240 = add i32 %234, %239
  %241 = zext i32 %240 to i64
  %242 = getelementptr inbounds %struct.PPMPixel, ptr %233, i64 %241
  %243 = getelementptr inbounds %struct.PPMPixel, ptr %242, i32 0, i32 0
  store i8 %230, ptr %243, align 1, !tbaa !17
  %244 = load double, ptr %13, align 8, !tbaa !9
  %245 = load double, ptr %15, align 8, !tbaa !9
  %246 = fdiv double %244, %245
  %247 = call double @llvm.round.f64(double %246)
  %248 = fptoui double %247 to i8
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.PPMImage, ptr %249, i32 0, i32 2
  %251 = load ptr, ptr %250, align 8, !tbaa !16
  %252 = load i32, ptr %11, align 4, !tbaa !15
  %253 = load i32, ptr %10, align 4, !tbaa !15
  %254 = load ptr, ptr %5, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.PPMImage, ptr %254, i32 0, i32 0
  %256 = load i32, ptr %255, align 8, !tbaa !11
  %257 = mul i32 %253, %256
  %258 = add i32 %252, %257
  %259 = zext i32 %258 to i64
  %260 = getelementptr inbounds %struct.PPMPixel, ptr %251, i64 %259
  %261 = getelementptr inbounds %struct.PPMPixel, ptr %260, i32 0, i32 1
  store i8 %248, ptr %261, align 1, !tbaa !19
  %262 = load double, ptr %14, align 8, !tbaa !9
  %263 = load double, ptr %15, align 8, !tbaa !9
  %264 = fdiv double %262, %263
  %265 = call double @llvm.round.f64(double %264)
  %266 = fptoui double %265 to i8
  %267 = load ptr, ptr %5, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.PPMImage, ptr %267, i32 0, i32 2
  %269 = load ptr, ptr %268, align 8, !tbaa !16
  %270 = load i32, ptr %11, align 4, !tbaa !15
  %271 = load i32, ptr %10, align 4, !tbaa !15
  %272 = load ptr, ptr %5, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.PPMImage, ptr %272, i32 0, i32 0
  %274 = load i32, ptr %273, align 8, !tbaa !11
  %275 = mul i32 %271, %274
  %276 = add i32 %270, %275
  %277 = zext i32 %276 to i64
  %278 = getelementptr inbounds %struct.PPMPixel, ptr %269, i64 %277
  %279 = getelementptr inbounds %struct.PPMPixel, ptr %278, i32 0, i32 2
  store i8 %266, ptr %279, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %280

280:                                              ; preds = %225
  %281 = load i32, ptr %11, align 4, !tbaa !15
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %11, align 4, !tbaa !15
  br label %39, !llvm.loop !24

283:                                              ; preds = %39
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %10, align 4, !tbaa !15
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %10, align 4, !tbaa !15
  br label %32, !llvm.loop !25

287:                                              ; preds = %32
  %288 = load ptr, ptr %3, align 8, !tbaa !5
  %289 = load ptr, ptr %5, align 8, !tbaa !5
  call void @copyPPMImage(ptr noundef %288, ptr noundef %289)
  %290 = load ptr, ptr %5, align 8, !tbaa !5
  call void @deletePPMImage(ptr noundef %290)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

; Function Attrs: nounwind
declare double @exp(double noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!18, !7, i64 0}
!18 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2}
!19 = !{!18, !7, i64 1}
!20 = !{!18, !7, i64 2}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}


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

%struct.PPMPixel = type { i8, i8, i8 }

@BLACK = external dso_local local_unnamed_addr constant %struct.PPMPixel, align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @createPPMImage(i32 noundef, i32 noundef, i24) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @deletePPMImage(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @copyPPMImage(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @adjustBlur(ptr noundef %0, double noundef %1) local_unnamed_addr #0 {
  %3 = load i32, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load i32, ptr %4, align 4, !tbaa !11
  %.0.copyload = load i24, ptr @BLACK, align 1
  %6 = tail call ptr @createPPMImage(i32 noundef %3, i32 noundef %5, i24 %.0.copyload)
  %7 = fmul double %1, 2.570000e+00
  %8 = tail call double @llvm.ceil.f64(double %7)
  %9 = fptosi double %8 to i32
  %10 = load i32, ptr %4, align 4, !tbaa !11
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge138

.preheader.lr.ph:                                 ; preds = %2
  %square101 = fmul double %1, %1
  %12 = fmul double %square101, 2.000000e+00
  %13 = fmul double %square101, 0x401921FB54442D18
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  %15 = getelementptr inbounds i8, ptr %6, i64 8
  %16 = load i32, ptr %0, align 8, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader.preheader, label %._crit_edge138

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %18 = add i32 %9, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge136
  %19 = phi i32 [ %10, %.preheader.preheader ], [ %119, %._crit_edge136 ]
  %20 = phi i32 [ %16, %.preheader.preheader ], [ %120, %._crit_edge136 ]
  %21 = phi i32 [ %16, %.preheader.preheader ], [ %121, %._crit_edge136 ]
  %indvars.iv150 = phi i32 [ %18, %.preheader.preheader ], [ %indvars.iv.next151, %._crit_edge136 ]
  %.084137 = phi i32 [ 0, %.preheader.preheader ], [ %122, %._crit_edge136 ]
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph135, label %._crit_edge136

.lr.ph135:                                        ; preds = %.preheader
  %23 = sub nsw i32 %.084137, %9
  %24 = add nsw i32 %.084137, %9
  %.not115 = icmp sgt i32 %23, %24
  br label %25

25:                                               ; preds = %.lr.ph135, %._crit_edge124
  %26 = phi i32 [ %20, %.lr.ph135 ], [ %96, %._crit_edge124 ]
  %indvars.iv = phi i32 [ %18, %.lr.ph135 ], [ %indvars.iv.next, %._crit_edge124 ]
  %.085133 = phi i32 [ 0, %.lr.ph135 ], [ %117, %._crit_edge124 ]
  br i1 %.not115, label %._crit_edge124, label %.lr.ph123

.lr.ph123:                                        ; preds = %25
  %27 = sub nsw i32 %.085133, %9
  %28 = add nsw i32 %.085133, %9
  %.not97103 = icmp sgt i32 %27, %28
  br i1 %.not97103, label %._crit_edge124, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph123, %._crit_edge
  %.083120 = phi i32 [ %95, %._crit_edge ], [ %23, %.lr.ph123 ]
  %.086119 = phi double [ %.us-phi114, %._crit_edge ], [ 0.000000e+00, %.lr.ph123 ]
  %.087118 = phi double [ %.us-phi113, %._crit_edge ], [ 0.000000e+00, %.lr.ph123 ]
  %29 = phi <2 x double> [ %94, %._crit_edge ], [ zeroinitializer, %.lr.ph123 ]
  %30 = icmp sgt i32 %.083120, 0
  %31 = sub nsw i32 %.083120, %.084137
  %32 = sitofp i32 %31 to double
  %square100 = fmul double %32, %32
  br i1 %30, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %38
  %.0108.us = phi i32 [ %65, %38 ], [ %27, %.lr.ph ]
  %.1107.us = phi double [ %64, %38 ], [ %.086119, %.lr.ph ]
  %.188106.us = phi double [ %63, %38 ], [ %.087118, %.lr.ph ]
  %33 = phi <2 x double> [ %59, %38 ], [ %29, %.lr.ph ]
  %34 = icmp sgt i32 %.0108.us, 0
  br i1 %34, label %35, label %38

35:                                               ; preds = %.lr.ph.split.us
  %36 = load i32, ptr %0, align 8, !tbaa !5
  %37 = add nsw i32 %36, -1
  %.0..us = tail call i32 @llvm.smin.i32(i32 %.0108.us, i32 %37)
  br label %38

38:                                               ; preds = %35, %.lr.ph.split.us
  %39 = phi i32 [ %.0..us, %35 ], [ 0, %.lr.ph.split.us ]
  %40 = load i32, ptr %4, align 4, !tbaa !11
  %41 = add nsw i32 %40, -1
  %.083..us = tail call i32 @llvm.smin.i32(i32 %.083120, i32 %41)
  %42 = sub nsw i32 %.0108.us, %.085133
  %43 = sitofp i32 %42 to double
  %square.us = fmul double %43, %43
  %44 = fadd double %square100, %square.us
  %45 = fneg double %44
  %46 = fdiv double %45, %12
  %47 = tail call double @exp(double noundef %46) #4
  %48 = fdiv double %47, %13
  %49 = load ptr, ptr %14, align 8, !tbaa !12
  %50 = load i32, ptr %0, align 8, !tbaa !5
  %51 = mul i32 %50, %.083..us
  %52 = add i32 %51, %39
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %struct.PPMPixel, ptr %49, i64 %53
  %55 = load <2 x i8>, ptr %54, align 1, !tbaa !13
  %56 = uitofp <2 x i8> %55 to <2 x double>
  %57 = insertelement <2 x double> poison, double %48, i64 0
  %58 = shufflevector <2 x double> %57, <2 x double> poison, <2 x i32> zeroinitializer
  %59 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %56, <2 x double> %58, <2 x double> %33)
  %60 = getelementptr inbounds i8, ptr %54, i64 2
  %61 = load i8, ptr %60, align 1, !tbaa !14
  %62 = uitofp i8 %61 to double
  %63 = tail call double @llvm.fmuladd.f64(double %62, double %48, double %.188106.us)
  %64 = fadd double %.1107.us, %48
  %65 = add i32 %.0108.us, 1
  %exitcond149.not = icmp eq i32 %65, %indvars.iv
  br i1 %exitcond149.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !16

.lr.ph.split:                                     ; preds = %.lr.ph, %71
  %.0108 = phi i32 [ %93, %71 ], [ %27, %.lr.ph ]
  %.1107 = phi double [ %92, %71 ], [ %.086119, %.lr.ph ]
  %.188106 = phi double [ %91, %71 ], [ %.087118, %.lr.ph ]
  %66 = phi <2 x double> [ %87, %71 ], [ %29, %.lr.ph ]
  %67 = icmp sgt i32 %.0108, 0
  br i1 %67, label %68, label %71

68:                                               ; preds = %.lr.ph.split
  %69 = load i32, ptr %0, align 8, !tbaa !5
  %70 = add nsw i32 %69, -1
  %.0. = tail call i32 @llvm.smin.i32(i32 %.0108, i32 %70)
  br label %71

71:                                               ; preds = %.lr.ph.split, %68
  %72 = phi i32 [ %.0., %68 ], [ 0, %.lr.ph.split ]
  %73 = sub nsw i32 %.0108, %.085133
  %74 = sitofp i32 %73 to double
  %square = fmul double %74, %74
  %75 = fadd double %square100, %square
  %76 = fneg double %75
  %77 = fdiv double %76, %12
  %78 = tail call double @exp(double noundef %77) #4
  %79 = fdiv double %78, %13
  %80 = load ptr, ptr %14, align 8, !tbaa !12
  %81 = zext i32 %72 to i64
  %82 = getelementptr inbounds %struct.PPMPixel, ptr %80, i64 %81
  %83 = load <2 x i8>, ptr %82, align 1, !tbaa !13
  %84 = uitofp <2 x i8> %83 to <2 x double>
  %85 = insertelement <2 x double> poison, double %79, i64 0
  %86 = shufflevector <2 x double> %85, <2 x double> poison, <2 x i32> zeroinitializer
  %87 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %84, <2 x double> %86, <2 x double> %66)
  %88 = getelementptr inbounds i8, ptr %82, i64 2
  %89 = load i8, ptr %88, align 1, !tbaa !14
  %90 = uitofp i8 %89 to double
  %91 = tail call double @llvm.fmuladd.f64(double %90, double %79, double %.188106)
  %92 = fadd double %.1107, %79
  %93 = add i32 %.0108, 1
  %exitcond.not = icmp eq i32 %93, %indvars.iv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !16

._crit_edge:                                      ; preds = %71, %38
  %.us-phi113 = phi double [ %63, %38 ], [ %91, %71 ]
  %.us-phi114 = phi double [ %64, %38 ], [ %92, %71 ]
  %94 = phi <2 x double> [ %59, %38 ], [ %87, %71 ]
  %95 = add i32 %.083120, 1
  %exitcond152.not = icmp eq i32 %95, %indvars.iv150
  br i1 %exitcond152.not, label %._crit_edge124.loopexit140, label %.lr.ph, !llvm.loop !18

._crit_edge124.loopexit140:                       ; preds = %._crit_edge
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %._crit_edge124

._crit_edge124:                                   ; preds = %.lr.ph123, %._crit_edge124.loopexit140, %25
  %96 = phi i32 [ %26, %25 ], [ %.pre, %._crit_edge124.loopexit140 ], [ %26, %.lr.ph123 ]
  %.087.lcssa = phi double [ 0.000000e+00, %25 ], [ %.us-phi113, %._crit_edge124.loopexit140 ], [ 0.000000e+00, %.lr.ph123 ]
  %.086.lcssa = phi double [ 0.000000e+00, %25 ], [ %.us-phi114, %._crit_edge124.loopexit140 ], [ 0.000000e+00, %.lr.ph123 ]
  %97 = phi <2 x double> [ zeroinitializer, %25 ], [ %94, %._crit_edge124.loopexit140 ], [ zeroinitializer, %.lr.ph123 ]
  %98 = extractelement <2 x double> %97, i64 0
  %99 = fdiv double %98, %.086.lcssa
  %100 = tail call double @llvm.round.f64(double %99)
  %101 = fptoui double %100 to i8
  %102 = load ptr, ptr %15, align 8, !tbaa !12
  %103 = load i32, ptr %6, align 8, !tbaa !5
  %104 = mul i32 %103, %.084137
  %105 = add i32 %104, %.085133
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds %struct.PPMPixel, ptr %102, i64 %106
  store i8 %101, ptr %107, align 1, !tbaa !19
  %108 = extractelement <2 x double> %97, i64 1
  %109 = fdiv double %108, %.086.lcssa
  %110 = tail call double @llvm.round.f64(double %109)
  %111 = fptoui double %110 to i8
  %112 = getelementptr inbounds %struct.PPMPixel, ptr %102, i64 %106, i32 1
  store i8 %111, ptr %112, align 1, !tbaa !20
  %113 = fdiv double %.087.lcssa, %.086.lcssa
  %114 = tail call double @llvm.round.f64(double %113)
  %115 = fptoui double %114 to i8
  %116 = getelementptr inbounds %struct.PPMPixel, ptr %102, i64 %106, i32 2
  store i8 %115, ptr %116, align 1, !tbaa !14
  %117 = add nuw nsw i32 %.085133, 1
  %118 = icmp slt i32 %117, %96
  %indvars.iv.next = add i32 %indvars.iv, 1
  br i1 %118, label %25, label %._crit_edge136.loopexit, !llvm.loop !21

._crit_edge136.loopexit:                          ; preds = %._crit_edge124
  %.pre153 = load i32, ptr %4, align 4, !tbaa !11
  br label %._crit_edge136

._crit_edge136:                                   ; preds = %._crit_edge136.loopexit, %.preheader
  %119 = phi i32 [ %.pre153, %._crit_edge136.loopexit ], [ %19, %.preheader ]
  %120 = phi i32 [ %96, %._crit_edge136.loopexit ], [ %20, %.preheader ]
  %121 = phi i32 [ %96, %._crit_edge136.loopexit ], [ %21, %.preheader ]
  %122 = add nuw nsw i32 %.084137, 1
  %123 = icmp slt i32 %122, %119
  %indvars.iv.next151 = add i32 %indvars.iv150, 1
  br i1 %123, label %.preheader, label %._crit_edge138, !llvm.loop !22

._crit_edge138:                                   ; preds = %._crit_edge136, %.preheader.lr.ph, %2
  tail call void @copyPPMImage(ptr noundef nonnull %0, ptr noundef %6)
  tail call void @deletePPMImage(ptr noundef %6)
  ret void
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!8, !8, i64 0}
!14 = !{!15, !8, i64 2}
!15 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!15, !8, i64 0}
!20 = !{!15, !8, i64 1}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17, !23}
!23 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass