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

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

; 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 double @truncateRGB(double noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @adjustHue(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca [3 x [3 x double]], align 16
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %18 = load i32, ptr %4, align 4, !tbaa !9
  %19 = srem i32 %18, 360
  %20 = add nsw i32 %19, 360
  %21 = srem i32 %20, 360
  store i32 %21, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %22 = load i32, ptr %4, align 4, !tbaa !9
  %23 = sitofp i32 %22 to double
  %24 = fmul double %23, 0x400921FB54442D18
  %25 = fdiv double %24, 1.800000e+02
  %26 = call double @cos(double noundef %25) #4
  store double %26, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %27 = load i32, ptr %4, align 4, !tbaa !9
  %28 = sitofp i32 %27 to double
  %29 = fmul double %28, 0x400921FB54442D18
  %30 = fdiv double %29, 1.800000e+02
  %31 = call double @sin(double noundef %30) #4
  store double %31, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 2.126000e-01, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 7.152000e-01, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 7.220000e-02, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store double 1.430000e-01, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store double 1.400000e-01, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store double 2.830000e-01, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %253, %2
  %33 = load i32, ptr %13, align 4, !tbaa !9
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.PPMImage, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.PPMImage, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !15
  %40 = mul i32 %36, %39
  %41 = icmp ult i32 %33, %40
  br i1 %41, label %42, label %256

42:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #4
  %43 = load double, ptr %5, align 8, !tbaa !11
  %44 = call double @llvm.fmuladd.f64(double 7.874000e-01, double %43, double 2.126000e-01)
  %45 = load double, ptr %6, align 8, !tbaa !11
  %46 = call double @llvm.fmuladd.f64(double -2.126000e-01, double %45, double %44)
  %47 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %48 = getelementptr inbounds [3 x double], ptr %47, i64 0, i64 0
  store double %46, ptr %48, align 16, !tbaa !11
  %49 = load double, ptr %5, align 8, !tbaa !11
  %50 = call double @llvm.fmuladd.f64(double -7.152000e-01, double %49, double 7.152000e-01)
  %51 = load double, ptr %6, align 8, !tbaa !11
  %52 = call double @llvm.fmuladd.f64(double -7.152000e-01, double %51, double %50)
  %53 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0, i64 1
  store double %52, ptr %54, align 8, !tbaa !11
  %55 = load double, ptr %5, align 8, !tbaa !11
  %56 = call double @llvm.fmuladd.f64(double -7.220000e-02, double %55, double 7.220000e-02)
  %57 = load double, ptr %6, align 8, !tbaa !11
  %58 = call double @llvm.fmuladd.f64(double 0x3FEDB089A0275254, double %57, double %56)
  %59 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %60 = getelementptr inbounds [3 x double], ptr %59, i64 0, i64 2
  store double %58, ptr %60, align 16, !tbaa !11
  %61 = load double, ptr %5, align 8, !tbaa !11
  %62 = call double @llvm.fmuladd.f64(double -2.126000e-01, double %61, double 2.126000e-01)
  %63 = load double, ptr %6, align 8, !tbaa !11
  %64 = call double @llvm.fmuladd.f64(double 1.430000e-01, double %63, double %62)
  %65 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %66 = getelementptr inbounds [3 x double], ptr %65, i64 0, i64 0
  store double %64, ptr %66, align 8, !tbaa !11
  %67 = load double, ptr %5, align 8, !tbaa !11
  %68 = call double @llvm.fmuladd.f64(double 0x3FD23A29C779A6B6, double %67, double 7.152000e-01)
  %69 = load double, ptr %6, align 8, !tbaa !11
  %70 = call double @llvm.fmuladd.f64(double 1.400000e-01, double %69, double %68)
  %71 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %72 = getelementptr inbounds [3 x double], ptr %71, i64 0, i64 1
  store double %70, ptr %72, align 8, !tbaa !11
  %73 = load double, ptr %5, align 8, !tbaa !11
  %74 = call double @llvm.fmuladd.f64(double -7.220000e-02, double %73, double 7.220000e-02)
  %75 = load double, ptr %6, align 8, !tbaa !11
  %76 = call double @llvm.fmuladd.f64(double -2.830000e-01, double %75, double %74)
  %77 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %78 = getelementptr inbounds [3 x double], ptr %77, i64 0, i64 2
  store double %76, ptr %78, align 8, !tbaa !11
  %79 = load double, ptr %5, align 8, !tbaa !11
  %80 = call double @llvm.fmuladd.f64(double -2.126000e-01, double %79, double 2.126000e-01)
  %81 = load double, ptr %6, align 8, !tbaa !11
  %82 = call double @llvm.fmuladd.f64(double -7.874000e-01, double %81, double %80)
  %83 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %84 = getelementptr inbounds [3 x double], ptr %83, i64 0, i64 0
  store double %82, ptr %84, align 16, !tbaa !11
  %85 = load double, ptr %5, align 8, !tbaa !11
  %86 = call double @llvm.fmuladd.f64(double -7.152000e-01, double %85, double 7.152000e-01)
  %87 = load double, ptr %6, align 8, !tbaa !11
  %88 = call double @llvm.fmuladd.f64(double 7.152000e-01, double %87, double %86)
  %89 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %90 = getelementptr inbounds [3 x double], ptr %89, i64 0, i64 1
  store double %88, ptr %90, align 8, !tbaa !11
  %91 = load double, ptr %5, align 8, !tbaa !11
  %92 = call double @llvm.fmuladd.f64(double 0x3FEDB089A0275254, double %91, double 7.220000e-02)
  %93 = load double, ptr %6, align 8, !tbaa !11
  %94 = call double @llvm.fmuladd.f64(double 7.220000e-02, double %93, double %92)
  %95 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %96 = getelementptr inbounds [3 x double], ptr %95, i64 0, i64 2
  store double %94, ptr %96, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %97 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %98 = getelementptr inbounds [3 x double], ptr %97, i64 0, i64 0
  %99 = load double, ptr %98, align 16, !tbaa !11
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.PPMImage, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !16
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = zext i32 %103 to i64
  %105 = getelementptr inbounds %struct.PPMPixel, ptr %102, i64 %104
  %106 = getelementptr inbounds %struct.PPMPixel, ptr %105, i32 0, i32 0
  %107 = load i8, ptr %106, align 1, !tbaa !17
  %108 = zext i8 %107 to i32
  %109 = sitofp i32 %108 to double
  %110 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %111 = getelementptr inbounds [3 x double], ptr %110, i64 0, i64 1
  %112 = load double, ptr %111, align 8, !tbaa !11
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.PPMImage, ptr %113, i32 0, i32 2
  %115 = load ptr, ptr %114, align 8, !tbaa !16
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds %struct.PPMPixel, ptr %115, i64 %117
  %119 = getelementptr inbounds %struct.PPMPixel, ptr %118, i32 0, i32 1
  %120 = load i8, ptr %119, align 1, !tbaa !19
  %121 = zext i8 %120 to i32
  %122 = sitofp i32 %121 to double
  %123 = fmul double %112, %122
  %124 = call double @llvm.fmuladd.f64(double %99, double %109, double %123)
  %125 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 0
  %126 = getelementptr inbounds [3 x double], ptr %125, i64 0, i64 2
  %127 = load double, ptr %126, align 16, !tbaa !11
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.PPMImage, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !16
  %131 = load i32, ptr %13, align 4, !tbaa !9
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds %struct.PPMPixel, ptr %130, i64 %132
  %134 = getelementptr inbounds %struct.PPMPixel, ptr %133, i32 0, i32 2
  %135 = load i8, ptr %134, align 1, !tbaa !20
  %136 = zext i8 %135 to i32
  %137 = sitofp i32 %136 to double
  %138 = call double @llvm.fmuladd.f64(double %127, double %137, double %124)
  store double %138, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %139 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %140 = getelementptr inbounds [3 x double], ptr %139, i64 0, i64 0
  %141 = load double, ptr %140, align 8, !tbaa !11
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.PPMImage, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !16
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds %struct.PPMPixel, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct.PPMPixel, ptr %147, i32 0, i32 0
  %149 = load i8, ptr %148, align 1, !tbaa !17
  %150 = zext i8 %149 to i32
  %151 = sitofp i32 %150 to double
  %152 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %153 = getelementptr inbounds [3 x double], ptr %152, i64 0, i64 1
  %154 = load double, ptr %153, align 8, !tbaa !11
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.PPMImage, ptr %155, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !16
  %158 = load i32, ptr %13, align 4, !tbaa !9
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds %struct.PPMPixel, ptr %157, i64 %159
  %161 = getelementptr inbounds %struct.PPMPixel, ptr %160, i32 0, i32 1
  %162 = load i8, ptr %161, align 1, !tbaa !19
  %163 = zext i8 %162 to i32
  %164 = sitofp i32 %163 to double
  %165 = fmul double %154, %164
  %166 = call double @llvm.fmuladd.f64(double %141, double %151, double %165)
  %167 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 1
  %168 = getelementptr inbounds [3 x double], ptr %167, i64 0, i64 2
  %169 = load double, ptr %168, align 8, !tbaa !11
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.PPMImage, ptr %170, i32 0, i32 2
  %172 = load ptr, ptr %171, align 8, !tbaa !16
  %173 = load i32, ptr %13, align 4, !tbaa !9
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds %struct.PPMPixel, ptr %172, i64 %174
  %176 = getelementptr inbounds %struct.PPMPixel, ptr %175, i32 0, i32 2
  %177 = load i8, ptr %176, align 1, !tbaa !20
  %178 = zext i8 %177 to i32
  %179 = sitofp i32 %178 to double
  %180 = call double @llvm.fmuladd.f64(double %169, double %179, double %166)
  store double %180, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %181 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %182 = getelementptr inbounds [3 x double], ptr %181, i64 0, i64 0
  %183 = load double, ptr %182, align 16, !tbaa !11
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.PPMImage, ptr %184, i32 0, i32 2
  %186 = load ptr, ptr %185, align 8, !tbaa !16
  %187 = load i32, ptr %13, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds %struct.PPMPixel, ptr %186, i64 %188
  %190 = getelementptr inbounds %struct.PPMPixel, ptr %189, i32 0, i32 0
  %191 = load i8, ptr %190, align 1, !tbaa !17
  %192 = zext i8 %191 to i32
  %193 = sitofp i32 %192 to double
  %194 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %195 = getelementptr inbounds [3 x double], ptr %194, i64 0, i64 1
  %196 = load double, ptr %195, align 8, !tbaa !11
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.PPMImage, ptr %197, i32 0, i32 2
  %199 = load ptr, ptr %198, align 8, !tbaa !16
  %200 = load i32, ptr %13, align 4, !tbaa !9
  %201 = zext i32 %200 to i64
  %202 = getelementptr inbounds %struct.PPMPixel, ptr %199, i64 %201
  %203 = getelementptr inbounds %struct.PPMPixel, ptr %202, i32 0, i32 1
  %204 = load i8, ptr %203, align 1, !tbaa !19
  %205 = zext i8 %204 to i32
  %206 = sitofp i32 %205 to double
  %207 = fmul double %196, %206
  %208 = call double @llvm.fmuladd.f64(double %183, double %193, double %207)
  %209 = getelementptr inbounds [3 x [3 x double]], ptr %14, i64 0, i64 2
  %210 = getelementptr inbounds [3 x double], ptr %209, i64 0, i64 2
  %211 = load double, ptr %210, align 16, !tbaa !11
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.PPMImage, ptr %212, i32 0, i32 2
  %214 = load ptr, ptr %213, align 8, !tbaa !16
  %215 = load i32, ptr %13, align 4, !tbaa !9
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds %struct.PPMPixel, ptr %214, i64 %216
  %218 = getelementptr inbounds %struct.PPMPixel, ptr %217, i32 0, i32 2
  %219 = load i8, ptr %218, align 1, !tbaa !20
  %220 = zext i8 %219 to i32
  %221 = sitofp i32 %220 to double
  %222 = call double @llvm.fmuladd.f64(double %211, double %221, double %208)
  store double %222, ptr %17, align 8, !tbaa !11
  %223 = load double, ptr %15, align 8, !tbaa !11
  %224 = call double @truncateRGB(double noundef %223)
  %225 = fptoui double %224 to i8
  %226 = load ptr, ptr %3, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.PPMImage, ptr %226, i32 0, i32 2
  %228 = load ptr, ptr %227, align 8, !tbaa !16
  %229 = load i32, ptr %13, align 4, !tbaa !9
  %230 = zext i32 %229 to i64
  %231 = getelementptr inbounds %struct.PPMPixel, ptr %228, i64 %230
  %232 = getelementptr inbounds %struct.PPMPixel, ptr %231, i32 0, i32 0
  store i8 %225, ptr %232, align 1, !tbaa !17
  %233 = load double, ptr %16, align 8, !tbaa !11
  %234 = call double @truncateRGB(double noundef %233)
  %235 = fptoui double %234 to i8
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.PPMImage, ptr %236, i32 0, i32 2
  %238 = load ptr, ptr %237, align 8, !tbaa !16
  %239 = load i32, ptr %13, align 4, !tbaa !9
  %240 = zext i32 %239 to i64
  %241 = getelementptr inbounds %struct.PPMPixel, ptr %238, i64 %240
  %242 = getelementptr inbounds %struct.PPMPixel, ptr %241, i32 0, i32 1
  store i8 %235, ptr %242, align 1, !tbaa !19
  %243 = load double, ptr %17, align 8, !tbaa !11
  %244 = call double @truncateRGB(double noundef %243)
  %245 = fptoui double %244 to i8
  %246 = load ptr, ptr %3, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.PPMImage, ptr %246, i32 0, i32 2
  %248 = load ptr, ptr %247, align 8, !tbaa !16
  %249 = load i32, ptr %13, align 4, !tbaa !9
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds %struct.PPMPixel, ptr %248, i64 %250
  %252 = getelementptr inbounds %struct.PPMPixel, ptr %251, i32 0, i32 2
  store i8 %245, ptr %252, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #4
  br label %253

253:                                              ; preds = %42
  %254 = load i32, ptr %13, align 4, !tbaa !9
  %255 = add i32 %254, 1
  store i32 %255, ptr %13, align 4, !tbaa !9
  br label %32, !llvm.loop !21

256:                                              ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret void
}

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind
declare double @sin(double noundef) #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 nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8}
!15 = !{!14, !10, i64 4}
!16 = !{!14, !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"}


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

; Function Attrs: nounwind uwtable
declare dso_local double @truncateRGB(double 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 @adjustHue(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = srem i32 %1, 360
  %4 = add nsw i32 %3, 360
  %.cmp = icmp ugt i32 %3, -361
  %5 = select i1 %.cmp, i32 %4, i32 %3
  %6 = uitofp nneg i32 %5 to double
  %7 = fmul double %6, 0x400921FB54442D18
  %8 = fdiv double %7, 1.800000e+02
  %9 = tail call double @cos(double noundef %8) #3
  %10 = tail call double @sin(double noundef %8) #3
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  %12 = load i32, ptr %0, align 8, !tbaa !5
  %13 = load i32, ptr %11, align 4, !tbaa !11
  %14 = mul i32 %13, %12
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %15 = tail call double @llvm.fmuladd.f64(double %9, double 7.874000e-01, double 2.126000e-01)
  %16 = tail call double @llvm.fmuladd.f64(double %10, double -2.126000e-01, double %15)
  %17 = tail call double @llvm.fmuladd.f64(double %9, double -7.152000e-01, double 7.152000e-01)
  %18 = tail call double @llvm.fmuladd.f64(double %10, double -7.152000e-01, double %17)
  %19 = tail call double @llvm.fmuladd.f64(double %9, double -7.220000e-02, double 7.220000e-02)
  %20 = tail call double @llvm.fmuladd.f64(double %10, double 0x3FEDB089A0275254, double %19)
  %21 = tail call double @llvm.fmuladd.f64(double %9, double -2.126000e-01, double 2.126000e-01)
  %22 = tail call double @llvm.fmuladd.f64(double %10, double 1.430000e-01, double %21)
  %23 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FD23A29C779A6B6, double 7.152000e-01)
  %24 = tail call double @llvm.fmuladd.f64(double %10, double 1.400000e-01, double %23)
  %25 = tail call double @llvm.fmuladd.f64(double %10, double -2.830000e-01, double %19)
  %26 = tail call double @llvm.fmuladd.f64(double %10, double -7.874000e-01, double %21)
  %27 = tail call double @llvm.fmuladd.f64(double %10, double 7.152000e-01, double %17)
  %28 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FEDB089A0275254, double 7.220000e-02)
  %29 = tail call double @llvm.fmuladd.f64(double %10, double 7.220000e-02, double %28)
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %.pre = load ptr, ptr %30, align 8, !tbaa !12
  br label %31

31:                                               ; preds = %.lr.ph, %31
  %32 = phi ptr [ %.pre, %.lr.ph ], [ %61, %31 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %33 = getelementptr inbounds %struct.PPMPixel, ptr %32, i64 %indvars.iv
  %34 = load i8, ptr %33, align 1, !tbaa !13
  %35 = uitofp i8 %34 to double
  %36 = getelementptr inbounds i8, ptr %33, i64 1
  %37 = load i8, ptr %36, align 1, !tbaa !15
  %38 = uitofp i8 %37 to double
  %39 = fmul double %18, %38
  %40 = tail call double @llvm.fmuladd.f64(double %16, double %35, double %39)
  %41 = getelementptr inbounds i8, ptr %33, i64 2
  %42 = load i8, ptr %41, align 1, !tbaa !16
  %43 = uitofp i8 %42 to double
  %44 = tail call double @llvm.fmuladd.f64(double %20, double %43, double %40)
  %45 = fmul double %24, %38
  %46 = tail call double @llvm.fmuladd.f64(double %22, double %35, double %45)
  %47 = tail call double @llvm.fmuladd.f64(double %25, double %43, double %46)
  %48 = fmul double %27, %38
  %49 = tail call double @llvm.fmuladd.f64(double %26, double %35, double %48)
  %50 = tail call double @llvm.fmuladd.f64(double %29, double %43, double %49)
  %51 = tail call double @truncateRGB(double noundef %44)
  %52 = fptoui double %51 to i8
  %53 = load ptr, ptr %30, align 8, !tbaa !12
  %54 = getelementptr inbounds %struct.PPMPixel, ptr %53, i64 %indvars.iv
  store i8 %52, ptr %54, align 1, !tbaa !13
  %55 = tail call double @truncateRGB(double noundef %47)
  %56 = fptoui double %55 to i8
  %57 = load ptr, ptr %30, align 8, !tbaa !12
  %58 = getelementptr inbounds %struct.PPMPixel, ptr %57, i64 %indvars.iv, i32 1
  store i8 %56, ptr %58, align 1, !tbaa !15
  %59 = tail call double @truncateRGB(double noundef %50)
  %60 = fptoui double %59 to i8
  %61 = load ptr, ptr %30, align 8, !tbaa !12
  %62 = getelementptr inbounds %struct.PPMPixel, ptr %61, i64 %indvars.iv, i32 2
  store i8 %60, ptr %62, align 1, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %63 = load i32, ptr %0, align 8, !tbaa !5
  %64 = load i32, ptr %11, align 4, !tbaa !11
  %65 = mul i32 %64, %63
  %66 = zext i32 %65 to i64
  %67 = icmp ult i64 %indvars.iv.next, %66
  br i1 %67, label %31, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %31, %2
  ret void
}

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

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

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 = { 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 = !{!14, !8, i64 0}
!14 = !{!"", !8, i64 0, !8, i64 1, !8, i64 2}
!15 = !{!14, !8, i64 1}
!16 = !{!14, !8, i64 2}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass