; LLVM IR from zchrissirhcz/pixel :: src (px_resize_linear)

; 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.px_size_t = type { i32, i32 }
%struct.px_image_t = type { ptr, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.px_resize_linear = external hidden unnamed_addr constant [61 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_resize_linear(ptr noundef %0, ptr noundef %1, i64 %2) #0 {
  %4 = alloca %struct.px_size_t, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca i32, align 4
  %28 = alloca i8, align 1
  %29 = alloca i8, align 1
  %30 = alloca i8, align 1
  %31 = alloca i8, align 1
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca i32, align 4
  store i64 %2, ptr %4, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %44

40:                                               ; preds = %3
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  br label %45

44:                                               ; preds = %40, %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 9, ptr noundef @__PRETTY_FUNCTION__.px_resize_linear) #5
  unreachable

45:                                               ; preds = %43
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i64, ptr %4, align 4
  %48 = call zeroext i1 @px_image_size_equal(ptr noundef %46, i64 %47)
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  br label %51

50:                                               ; preds = %45
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 10, ptr noundef @__PRETTY_FUNCTION__.px_resize_linear) #5
  unreachable

51:                                               ; preds = %49
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.px_image_t, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 8, !tbaa !9
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.px_image_t, ptr %55, i32 0, i32 3
  %57 = load i32, ptr %56, align 8, !tbaa !9
  %58 = icmp eq i32 %54, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %51
  br label %61

60:                                               ; preds = %51
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 11, ptr noundef @__PRETTY_FUNCTION__.px_resize_linear) #5
  unreachable

61:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.px_image_t, ptr %62, i32 0, i32 3
  %64 = load i32, ptr %63, align 8, !tbaa !9
  store i32 %64, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.px_image_t, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = sitofp i32 %67 to double
  %69 = fmul double %68, 1.000000e+00
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.px_image_t, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 4, !tbaa !13
  %73 = sitofp i32 %72 to double
  %74 = fdiv double %69, %73
  store double %74, ptr %8, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.px_image_t, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 8, !tbaa !16
  %78 = sitofp i32 %77 to double
  %79 = fmul double %78, 1.000000e+00
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.px_image_t, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 8, !tbaa !16
  %83 = sitofp i32 %82 to double
  %84 = fdiv double %79, %83
  store double %84, ptr %9, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !12
  br label %85

85:                                               ; preds = %285, %61
  %86 = load i32, ptr %18, align 4, !tbaa !12
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.px_image_t, ptr %87, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !13
  %90 = icmp slt i32 %86, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %85
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %288

92:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !12
  br label %93

93:                                               ; preds = %281, %92
  %94 = load i32, ptr %20, align 4, !tbaa !12
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.px_image_t, ptr %95, i32 0, i32 1
  %97 = load i32, ptr %96, align 8, !tbaa !16
  %98 = icmp slt i32 %94, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %93
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %284

100:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %101 = load i32, ptr %18, align 4, !tbaa !12
  store i32 %101, ptr %21, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %102 = load i32, ptr %20, align 4, !tbaa !12
  store i32 %102, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %103 = load i32, ptr %21, align 4, !tbaa !12
  %104 = sitofp i32 %103 to double
  %105 = fadd double %104, 5.000000e-01
  %106 = load double, ptr %8, align 8, !tbaa !14
  %107 = call double @llvm.fmuladd.f64(double %105, double %106, double -5.000000e-01)
  store double %107, ptr %23, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %108 = load i32, ptr %22, align 4, !tbaa !12
  %109 = sitofp i32 %108 to double
  %110 = fadd double %109, 5.000000e-01
  %111 = load double, ptr %9, align 8, !tbaa !14
  %112 = call double @llvm.fmuladd.f64(double %110, double %111, double -5.000000e-01)
  store double %112, ptr %24, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %113 = load double, ptr %23, align 8, !tbaa !14
  %114 = load double, ptr %23, align 8, !tbaa !14
  %115 = fptosi double %114 to i32
  %116 = sitofp i32 %115 to double
  %117 = fsub double %113, %116
  store double %117, ptr %25, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %118 = load double, ptr %24, align 8, !tbaa !14
  %119 = load double, ptr %24, align 8, !tbaa !14
  %120 = fptosi double %119 to i32
  %121 = sitofp i32 %120 to double
  %122 = fsub double %118, %121
  store double %122, ptr %26, align 8, !tbaa !14
  %123 = load double, ptr %23, align 8, !tbaa !14
  %124 = call double @llvm.floor.f64(double %123)
  %125 = fptosi double %124 to i32
  store i32 %125, ptr %10, align 4, !tbaa !12
  %126 = load double, ptr %24, align 8, !tbaa !14
  %127 = call double @llvm.floor.f64(double %126)
  %128 = fptosi double %127 to i32
  store i32 %128, ptr %11, align 4, !tbaa !12
  %129 = load double, ptr %23, align 8, !tbaa !14
  %130 = call double @llvm.floor.f64(double %129)
  %131 = fptosi double %130 to i32
  store i32 %131, ptr %12, align 4, !tbaa !12
  %132 = load double, ptr %24, align 8, !tbaa !14
  %133 = call double @llvm.ceil.f64(double %132)
  %134 = fptosi double %133 to i32
  store i32 %134, ptr %13, align 4, !tbaa !12
  %135 = load double, ptr %23, align 8, !tbaa !14
  %136 = call double @llvm.ceil.f64(double %135)
  %137 = fptosi double %136 to i32
  store i32 %137, ptr %14, align 4, !tbaa !12
  %138 = load double, ptr %24, align 8, !tbaa !14
  %139 = call double @llvm.floor.f64(double %138)
  %140 = fptosi double %139 to i32
  store i32 %140, ptr %15, align 4, !tbaa !12
  %141 = load double, ptr %23, align 8, !tbaa !14
  %142 = call double @llvm.ceil.f64(double %141)
  %143 = fptosi double %142 to i32
  store i32 %143, ptr %16, align 4, !tbaa !12
  %144 = load double, ptr %24, align 8, !tbaa !14
  %145 = call double @llvm.ceil.f64(double %144)
  %146 = fptosi double %145 to i32
  store i32 %146, ptr %17, align 4, !tbaa !12
  %147 = load i32, ptr %10, align 4, !tbaa !12
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.px_image_t, ptr %148, i32 0, i32 2
  %150 = load i32, ptr %149, align 4, !tbaa !13
  %151 = sub nsw i32 %150, 1
  %152 = call i32 @px_clamp(i32 noundef %147, i32 noundef 0, i32 noundef %151)
  store i32 %152, ptr %10, align 4, !tbaa !12
  %153 = load i32, ptr %12, align 4, !tbaa !12
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.px_image_t, ptr %154, i32 0, i32 2
  %156 = load i32, ptr %155, align 4, !tbaa !13
  %157 = sub nsw i32 %156, 1
  %158 = call i32 @px_clamp(i32 noundef %153, i32 noundef 0, i32 noundef %157)
  store i32 %158, ptr %12, align 4, !tbaa !12
  %159 = load i32, ptr %14, align 4, !tbaa !12
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.px_image_t, ptr %160, i32 0, i32 2
  %162 = load i32, ptr %161, align 4, !tbaa !13
  %163 = sub nsw i32 %162, 1
  %164 = call i32 @px_clamp(i32 noundef %159, i32 noundef 0, i32 noundef %163)
  store i32 %164, ptr %14, align 4, !tbaa !12
  %165 = load i32, ptr %16, align 4, !tbaa !12
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.px_image_t, ptr %166, i32 0, i32 2
  %168 = load i32, ptr %167, align 4, !tbaa !13
  %169 = sub nsw i32 %168, 1
  %170 = call i32 @px_clamp(i32 noundef %165, i32 noundef 0, i32 noundef %169)
  store i32 %170, ptr %16, align 4, !tbaa !12
  %171 = load i32, ptr %11, align 4, !tbaa !12
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.px_image_t, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 8, !tbaa !16
  %175 = sub nsw i32 %174, 1
  %176 = call i32 @px_clamp(i32 noundef %171, i32 noundef 0, i32 noundef %175)
  store i32 %176, ptr %11, align 4, !tbaa !12
  %177 = load i32, ptr %13, align 4, !tbaa !12
  %178 = load ptr, ptr %5, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.px_image_t, ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 8, !tbaa !16
  %181 = sub nsw i32 %180, 1
  %182 = call i32 @px_clamp(i32 noundef %177, i32 noundef 0, i32 noundef %181)
  store i32 %182, ptr %13, align 4, !tbaa !12
  %183 = load i32, ptr %15, align 4, !tbaa !12
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.px_image_t, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 8, !tbaa !16
  %187 = sub nsw i32 %186, 1
  %188 = call i32 @px_clamp(i32 noundef %183, i32 noundef 0, i32 noundef %187)
  store i32 %188, ptr %15, align 4, !tbaa !12
  %189 = load i32, ptr %17, align 4, !tbaa !12
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.px_image_t, ptr %190, i32 0, i32 1
  %192 = load i32, ptr %191, align 8, !tbaa !16
  %193 = sub nsw i32 %192, 1
  %194 = call i32 @px_clamp(i32 noundef %189, i32 noundef 0, i32 noundef %193)
  store i32 %194, ptr %17, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !12
  br label %195

195:                                              ; preds = %277, %100
  %196 = load i32, ptr %27, align 4, !tbaa !12
  %197 = load i32, ptr %7, align 4, !tbaa !12
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %200, label %199

199:                                              ; preds = %195
  store i32 8, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %280

200:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #6
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = load i32, ptr %10, align 4, !tbaa !12
  %203 = load i32, ptr %11, align 4, !tbaa !12
  %204 = load i32, ptr %27, align 4, !tbaa !12
  %205 = call zeroext i8 @px_get_pixel(ptr noundef %201, i32 noundef %202, i32 noundef %203, i32 noundef %204)
  store i8 %205, ptr %28, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #6
  %206 = load ptr, ptr %5, align 8, !tbaa !5
  %207 = load i32, ptr %12, align 4, !tbaa !12
  %208 = load i32, ptr %13, align 4, !tbaa !12
  %209 = load i32, ptr %27, align 4, !tbaa !12
  %210 = call zeroext i8 @px_get_pixel(ptr noundef %206, i32 noundef %207, i32 noundef %208, i32 noundef %209)
  store i8 %210, ptr %29, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #6
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = load i32, ptr %14, align 4, !tbaa !12
  %213 = load i32, ptr %15, align 4, !tbaa !12
  %214 = load i32, ptr %27, align 4, !tbaa !12
  %215 = call zeroext i8 @px_get_pixel(ptr noundef %211, i32 noundef %212, i32 noundef %213, i32 noundef %214)
  store i8 %215, ptr %30, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #6
  %216 = load ptr, ptr %5, align 8, !tbaa !5
  %217 = load i32, ptr %16, align 4, !tbaa !12
  %218 = load i32, ptr %17, align 4, !tbaa !12
  %219 = load i32, ptr %27, align 4, !tbaa !12
  %220 = call zeroext i8 @px_get_pixel(ptr noundef %216, i32 noundef %217, i32 noundef %218, i32 noundef %219)
  store i8 %220, ptr %31, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %221 = load double, ptr %26, align 8, !tbaa !14
  %222 = fsub double 1.000000e+00, %221
  %223 = load double, ptr %25, align 8, !tbaa !14
  %224 = fsub double 1.000000e+00, %223
  %225 = fmul double %222, %224
  store double %225, ptr %32, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %226 = load double, ptr %26, align 8, !tbaa !14
  %227 = load double, ptr %25, align 8, !tbaa !14
  %228 = fsub double 1.000000e+00, %227
  %229 = fmul double %226, %228
  store double %229, ptr %33, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  %230 = load double, ptr %26, align 8, !tbaa !14
  %231 = fsub double 1.000000e+00, %230
  %232 = load double, ptr %25, align 8, !tbaa !14
  %233 = fmul double %231, %232
  store double %233, ptr %34, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  %234 = load double, ptr %26, align 8, !tbaa !14
  %235 = load double, ptr %25, align 8, !tbaa !14
  %236 = fmul double %234, %235
  store double %236, ptr %35, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  %237 = load double, ptr %32, align 8, !tbaa !14
  %238 = load i8, ptr %28, align 1, !tbaa !17
  %239 = zext i8 %238 to i32
  %240 = sitofp i32 %239 to double
  %241 = load double, ptr %33, align 8, !tbaa !14
  %242 = load i8, ptr %29, align 1, !tbaa !17
  %243 = zext i8 %242 to i32
  %244 = sitofp i32 %243 to double
  %245 = fmul double %241, %244
  %246 = call double @llvm.fmuladd.f64(double %237, double %240, double %245)
  %247 = load double, ptr %34, align 8, !tbaa !14
  %248 = load i8, ptr %30, align 1, !tbaa !17
  %249 = zext i8 %248 to i32
  %250 = sitofp i32 %249 to double
  %251 = call double @llvm.fmuladd.f64(double %247, double %250, double %246)
  %252 = load double, ptr %35, align 8, !tbaa !14
  %253 = load i8, ptr %31, align 1, !tbaa !17
  %254 = zext i8 %253 to i32
  %255 = sitofp i32 %254 to double
  %256 = call double @llvm.fmuladd.f64(double %252, double %255, double %251)
  store double %256, ptr %36, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  %257 = load i32, ptr %21, align 4, !tbaa !12
  %258 = load ptr, ptr %6, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.px_image_t, ptr %258, i32 0, i32 4
  %260 = load i32, ptr %259, align 4, !tbaa !18
  %261 = mul nsw i32 %257, %260
  %262 = load i32, ptr %22, align 4, !tbaa !12
  %263 = load i32, ptr %7, align 4, !tbaa !12
  %264 = mul nsw i32 %262, %263
  %265 = add nsw i32 %261, %264
  %266 = load i32, ptr %27, align 4, !tbaa !12
  %267 = add nsw i32 %265, %266
  store i32 %267, ptr %37, align 4, !tbaa !12
  %268 = load double, ptr %36, align 8, !tbaa !14
  %269 = fadd double %268, 5.000000e-01
  %270 = fptoui double %269 to i8
  %271 = load ptr, ptr %6, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.px_image_t, ptr %271, i32 0, i32 0
  %273 = load ptr, ptr %272, align 8, !tbaa !19
  %274 = load i32, ptr %37, align 4, !tbaa !12
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds i8, ptr %273, i64 %275
  store i8 %270, ptr %276, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #6
  br label %277

277:                                              ; preds = %200
  %278 = load i32, ptr %27, align 4, !tbaa !12
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %27, align 4, !tbaa !12
  br label %195, !llvm.loop !20

280:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %20, align 4, !tbaa !12
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %20, align 4, !tbaa !12
  br label %93, !llvm.loop !22

284:                                              ; preds = %99
  br label %285

285:                                              ; preds = %284
  %286 = load i32, ptr %18, align 4, !tbaa !12
  %287 = add nsw i32 %286, 1
  store i32 %287, ptr %18, align 4, !tbaa !12
  br label %85, !llvm.loop !23

288:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

declare zeroext i1 @px_image_size_equal(ptr noundef, i64) #2

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

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

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

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

declare i32 @px_clamp(i32 noundef, i32 noundef, i32 noundef) #2

declare zeroext i8 @px_get_pixel(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { noreturn 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 #2 = { "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 willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !11, i64 16}
!10 = !{!"px_image_t", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !11, i64 20}
!19 = !{!10, !6, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}


; 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 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.px_resize_linear = external hidden unnamed_addr constant [61 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @px_resize_linear(ptr noundef %0, ptr noundef %1, i64 %2) local_unnamed_addr #0 {
  %4 = icmp ne ptr %0, null
  %5 = icmp ne ptr %1, null
  %or.cond = and i1 %4, %5
  br i1 %or.cond, label %7, label %6

6:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 9, ptr noundef nonnull @__PRETTY_FUNCTION__.px_resize_linear) #4
  unreachable

7:                                                ; preds = %3
  %8 = tail call zeroext i1 @px_image_size_equal(ptr noundef nonnull %1, i64 %2) #5
  br i1 %8, label %10, label %9

9:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 10, ptr noundef nonnull @__PRETTY_FUNCTION__.px_resize_linear) #4
  unreachable

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = icmp eq i32 %12, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 11, ptr noundef nonnull @__PRETTY_FUNCTION__.px_resize_linear) #4
  unreachable

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %0, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = sitofp i32 %19 to double
  %21 = getelementptr inbounds i8, ptr %1, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = sitofp i32 %22 to double
  %24 = fdiv double %20, %23
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !12
  %27 = sitofp i32 %26 to double
  %28 = getelementptr inbounds i8, ptr %1, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !12
  %30 = sitofp i32 %29 to double
  %31 = fdiv double %27, %30
  %32 = icmp sgt i32 %22, 0
  br i1 %32, label %.preheader.lr.ph, label %._crit_edge103

.preheader.lr.ph:                                 ; preds = %17
  %33 = icmp sgt i32 %12, 0
  %34 = getelementptr inbounds i8, ptr %1, i64 20
  %35 = icmp sgt i32 %29, 0
  br i1 %35, label %.preheader, label %._crit_edge103

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge101
  %36 = phi i32 [ %50, %._crit_edge101 ], [ %22, %.preheader.lr.ph ]
  %37 = phi i32 [ %51, %._crit_edge101 ], [ %29, %.preheader.lr.ph ]
  %.0102 = phi i32 [ %52, %._crit_edge101 ], [ 0, %.preheader.lr.ph ]
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph100, label %._crit_edge101

.lr.ph100:                                        ; preds = %.preheader
  %39 = uitofp nneg i32 %.0102 to double
  %40 = fadd double %39, 5.000000e-01
  %41 = tail call double @llvm.fmuladd.f64(double %40, double %24, double -5.000000e-01)
  %42 = fptosi double %41 to i32
  %43 = sitofp i32 %42 to double
  %44 = fsub double %41, %43
  %45 = tail call double @llvm.floor.f64(double %41)
  %46 = fptosi double %45 to i32
  %47 = tail call double @llvm.ceil.f64(double %41)
  %48 = fptosi double %47 to i32
  %49 = fsub double 1.000000e+00, %44
  br label %54

._crit_edge103:                                   ; preds = %._crit_edge101, %.preheader.lr.ph, %17
  ret void

._crit_edge101.loopexit:                          ; preds = %._crit_edge
  %.pre = load i32, ptr %21, align 4, !tbaa !11
  br label %._crit_edge101

._crit_edge101:                                   ; preds = %._crit_edge101.loopexit, %.preheader
  %50 = phi i32 [ %.pre, %._crit_edge101.loopexit ], [ %36, %.preheader ]
  %51 = phi i32 [ %96, %._crit_edge101.loopexit ], [ %37, %.preheader ]
  %52 = add nuw nsw i32 %.0102, 1
  %53 = icmp slt i32 %52, %50
  br i1 %53, label %.preheader, label %._crit_edge103, !llvm.loop !13

54:                                               ; preds = %.lr.ph100, %._crit_edge
  %.09499 = phi i32 [ 0, %.lr.ph100 ], [ %95, %._crit_edge ]
  %55 = uitofp nneg i32 %.09499 to double
  %56 = fadd double %55, 5.000000e-01
  %57 = tail call double @llvm.fmuladd.f64(double %56, double %31, double -5.000000e-01)
  %58 = tail call double @llvm.floor.f64(double %57)
  %59 = fptosi double %58 to i32
  %60 = tail call double @llvm.ceil.f64(double %57)
  %61 = fptosi double %60 to i32
  %62 = load i32, ptr %18, align 4, !tbaa !11
  %63 = add nsw i32 %62, -1
  %64 = tail call i32 @px_clamp(i32 noundef %46, i32 noundef 0, i32 noundef %63) #5
  %65 = load i32, ptr %18, align 4, !tbaa !11
  %66 = add nsw i32 %65, -1
  %67 = tail call i32 @px_clamp(i32 noundef %46, i32 noundef 0, i32 noundef %66) #5
  %68 = load i32, ptr %18, align 4, !tbaa !11
  %69 = add nsw i32 %68, -1
  %70 = tail call i32 @px_clamp(i32 noundef %48, i32 noundef 0, i32 noundef %69) #5
  %71 = load i32, ptr %18, align 4, !tbaa !11
  %72 = add nsw i32 %71, -1
  %73 = tail call i32 @px_clamp(i32 noundef %48, i32 noundef 0, i32 noundef %72) #5
  %74 = load i32, ptr %25, align 8, !tbaa !12
  %75 = add nsw i32 %74, -1
  %76 = tail call i32 @px_clamp(i32 noundef %59, i32 noundef 0, i32 noundef %75) #5
  %77 = load i32, ptr %25, align 8, !tbaa !12
  %78 = add nsw i32 %77, -1
  %79 = tail call i32 @px_clamp(i32 noundef %61, i32 noundef 0, i32 noundef %78) #5
  %80 = load i32, ptr %25, align 8, !tbaa !12
  %81 = add nsw i32 %80, -1
  %82 = tail call i32 @px_clamp(i32 noundef %59, i32 noundef 0, i32 noundef %81) #5
  %83 = load i32, ptr %25, align 8, !tbaa !12
  %84 = add nsw i32 %83, -1
  %85 = tail call i32 @px_clamp(i32 noundef %61, i32 noundef 0, i32 noundef %84) #5
  br i1 %33, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %54
  %86 = fptosi double %57 to i32
  %87 = sitofp i32 %86 to double
  %88 = fsub double %57, %87
  %89 = fsub double 1.000000e+00, %88
  %90 = fmul double %49, %89
  %91 = fmul double %49, %88
  %92 = fmul double %44, %89
  %93 = fmul double %44, %88
  %94 = mul nuw nsw i32 %.09499, %12
  br label %98

._crit_edge:                                      ; preds = %98, %54
  %95 = add nuw nsw i32 %.09499, 1
  %96 = load i32, ptr %28, align 8, !tbaa !12
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %54, label %._crit_edge101.loopexit, !llvm.loop !16

98:                                               ; preds = %.lr.ph, %98
  %.09398 = phi i32 [ 0, %.lr.ph ], [ %120, %98 ]
  %99 = tail call zeroext i8 @px_get_pixel(ptr noundef nonnull %0, i32 noundef %64, i32 noundef %76, i32 noundef %.09398) #5
  %100 = tail call zeroext i8 @px_get_pixel(ptr noundef nonnull %0, i32 noundef %67, i32 noundef %79, i32 noundef %.09398) #5
  %101 = tail call zeroext i8 @px_get_pixel(ptr noundef nonnull %0, i32 noundef %70, i32 noundef %82, i32 noundef %.09398) #5
  %102 = tail call zeroext i8 @px_get_pixel(ptr noundef nonnull %0, i32 noundef %73, i32 noundef %85, i32 noundef %.09398) #5
  %103 = uitofp i8 %99 to double
  %104 = uitofp i8 %100 to double
  %105 = fmul double %91, %104
  %106 = tail call double @llvm.fmuladd.f64(double %90, double %103, double %105)
  %107 = uitofp i8 %101 to double
  %108 = tail call double @llvm.fmuladd.f64(double %92, double %107, double %106)
  %109 = uitofp i8 %102 to double
  %110 = tail call double @llvm.fmuladd.f64(double %93, double %109, double %108)
  %111 = load i32, ptr %34, align 4, !tbaa !17
  %112 = mul nsw i32 %111, %.0102
  %113 = add nuw i32 %.09398, %94
  %114 = add i32 %113, %112
  %115 = fadd double %110, 5.000000e-01
  %116 = fptoui double %115 to i8
  %117 = load ptr, ptr %1, align 8, !tbaa !18
  %118 = sext i32 %114 to i64
  %119 = getelementptr inbounds i8, ptr %117, i64 %118
  store i8 %116, ptr %119, align 1, !tbaa !19
  %120 = add nuw nsw i32 %.09398, 1
  %exitcond.not = icmp eq i32 %120, %12
  br i1 %exitcond.not, label %._crit_edge, label %98, !llvm.loop !20
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i1 @px_image_size_equal(ptr noundef, i64) local_unnamed_addr #2

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

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

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

declare i32 @px_clamp(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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


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