; LLVM IR from rflynn/imgmin :: src (dssim)

; 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.dssim_info = type { [3 x %struct.dssim_info_chan], i32 }
%struct.dssim_info_chan = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #1

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nounwind uwtable
declare hidden void @convert_image(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden void @blur(ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @dssim_set_modified_float_callback(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) #4 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.dssim_info, ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %26, i64 0, i64 0
  %28 = getelementptr inbounds %struct.dssim_info_chan, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !11
  store i32 %29, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.dssim_info, ptr %30, i32 0, i32 0
  %32 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %31, i64 0, i64 0
  %33 = getelementptr inbounds %struct.dssim_info_chan, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !13
  store i32 %34, ptr %13, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = load i32, ptr %12, align 4, !tbaa !9
  %37 = icmp ne i32 %35, %36
  br i1 %37, label %42, label %38

38:                                               ; preds = %5
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = icmp ne i32 %39, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %38, %5
  store i32 1, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %260

43:                                               ; preds = %38
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.dssim_info, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !14
  %47 = zext i32 %46 to i64
  %48 = call ptr @llvm.stacksave.p0()
  store ptr %48, ptr %15, align 8
  %49 = alloca ptr, i64 %47, align 16
  store i64 %47, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %78, %43
  %51 = load i32, ptr %17, align 4, !tbaa !9
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.dssim_info, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 8, !tbaa !14
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %50
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %81

57:                                               ; preds = %50
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.dssim_info, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %17, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %59, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.dssim_info_chan, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !11
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.dssim_info, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %17, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %66, i64 0, i64 %68
  %70 = getelementptr inbounds %struct.dssim_info_chan, ptr %69, i32 0, i32 1
  %71 = load i32, ptr %70, align 4, !tbaa !13
  %72 = mul nsw i32 %64, %71
  %73 = sext i32 %72 to i64
  %74 = call noalias ptr @calloc(i64 noundef %73, i64 noundef 4) #7
  %75 = load i32, ptr %17, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds ptr, ptr %49, i64 %76
  store ptr %74, ptr %77, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %57
  %79 = load i32, ptr %17, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %17, align 4, !tbaa !9
  br label %50, !llvm.loop !16

81:                                               ; preds = %56
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  call void @convert_image(ptr noundef %82, ptr noundef %49, ptr noundef %83, ptr noundef %84)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = mul nsw i32 %85, %86
  %88 = sext i32 %87 to i64
  %89 = mul i64 %88, 4
  %90 = call noalias ptr @malloc(i64 noundef %89) #8
  store ptr %90, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %254, %81
  %92 = load i32, ptr %19, align 4, !tbaa !9
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.dssim_info, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 8, !tbaa !14
  %96 = icmp slt i32 %92, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %91
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %257

98:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.dssim_info, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %19, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %100, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.dssim_info_chan, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %104, align 8, !tbaa !11
  store i32 %105, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.dssim_info, ptr %106, i32 0, i32 0
  %108 = load i32, ptr %19, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %107, i64 0, i64 %109
  %111 = getelementptr inbounds %struct.dssim_info_chan, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !13
  store i32 %112, ptr %21, align 4, !tbaa !9
  %113 = load i32, ptr %19, align 4, !tbaa !9
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %115, label %127

115:                                              ; preds = %98
  %116 = load i32, ptr %19, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %49, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  %121 = load i32, ptr %19, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds ptr, ptr %49, i64 %122
  %124 = load ptr, ptr %123, align 8, !tbaa !5
  %125 = load i32, ptr %20, align 4, !tbaa !9
  %126 = load i32, ptr %21, align 4, !tbaa !9
  call void @blur(ptr noundef %119, ptr noundef %120, ptr noundef %124, i32 noundef %125, i32 noundef %126, ptr noundef null, i32 noundef 0)
  br label %127

127:                                              ; preds = %115, %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %128 = load i32, ptr %20, align 4, !tbaa !9
  %129 = load i32, ptr %21, align 4, !tbaa !9
  %130 = mul nsw i32 %128, %129
  %131 = sext i32 %130 to i64
  %132 = mul i64 %131, 4
  %133 = call noalias ptr @malloc(i64 noundef %132) #8
  store ptr %133, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.dssim_info, ptr %134, i32 0, i32 0
  %136 = load i32, ptr %19, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %135, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.dssim_info_chan, ptr %138, i32 0, i32 2
  %140 = load ptr, ptr %139, align 8, !tbaa !18
  store ptr %140, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %167, %127
  %142 = load i32, ptr %24, align 4, !tbaa !9
  %143 = load i32, ptr %20, align 4, !tbaa !9
  %144 = load i32, ptr %21, align 4, !tbaa !9
  %145 = mul nsw i32 %143, %144
  %146 = icmp slt i32 %142, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %141
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %170

148:                                              ; preds = %141
  %149 = load ptr, ptr %23, align 8, !tbaa !5
  %150 = load i32, ptr %24, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds float, ptr %149, i64 %151
  %153 = load float, ptr %152, align 4, !tbaa !19
  %154 = load i32, ptr %19, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %49, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = load i32, ptr %24, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds float, ptr %157, i64 %159
  %161 = load float, ptr %160, align 4, !tbaa !19
  %162 = fmul float %153, %161
  %163 = load ptr, ptr %22, align 8, !tbaa !5
  %164 = load i32, ptr %24, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds float, ptr %163, i64 %165
  store float %162, ptr %166, align 4, !tbaa !19
  br label %167

167:                                              ; preds = %148
  %168 = load i32, ptr %24, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %24, align 4, !tbaa !9
  br label %141, !llvm.loop !21

170:                                              ; preds = %147
  %171 = load i32, ptr %20, align 4, !tbaa !9
  %172 = load i32, ptr %21, align 4, !tbaa !9
  %173 = mul nsw i32 %171, %172
  %174 = sext i32 %173 to i64
  %175 = mul i64 %174, 4
  %176 = call noalias ptr @malloc(i64 noundef %175) #8
  %177 = load ptr, ptr %7, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.dssim_info, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %19, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %178, i64 0, i64 %180
  %182 = getelementptr inbounds %struct.dssim_info_chan, ptr %181, i32 0, i32 7
  store ptr %176, ptr %182, align 8, !tbaa !22
  %183 = load ptr, ptr %22, align 8, !tbaa !5
  %184 = load ptr, ptr %18, align 8, !tbaa !5
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.dssim_info, ptr %185, i32 0, i32 0
  %187 = load i32, ptr %19, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %186, i64 0, i64 %188
  %190 = getelementptr inbounds %struct.dssim_info_chan, ptr %189, i32 0, i32 7
  %191 = load ptr, ptr %190, align 8, !tbaa !22
  %192 = load i32, ptr %20, align 4, !tbaa !9
  %193 = load i32, ptr %21, align 4, !tbaa !9
  %194 = load i32, ptr %19, align 4, !tbaa !9
  %195 = icmp sgt i32 %194, 0
  %196 = zext i1 %195 to i32
  call void @blur(ptr noundef %183, ptr noundef %184, ptr noundef %191, i32 noundef %192, i32 noundef %193, ptr noundef null, i32 noundef %196)
  %197 = load ptr, ptr %22, align 8, !tbaa !5
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.dssim_info, ptr %198, i32 0, i32 0
  %200 = load i32, ptr %19, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %199, i64 0, i64 %201
  %203 = getelementptr inbounds %struct.dssim_info_chan, ptr %202, i32 0, i32 5
  store ptr %197, ptr %203, align 8, !tbaa !23
  %204 = load i32, ptr %19, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds ptr, ptr %49, i64 %205
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.dssim_info, ptr %209, i32 0, i32 0
  %211 = load i32, ptr %19, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %210, i64 0, i64 %212
  %214 = getelementptr inbounds %struct.dssim_info_chan, ptr %213, i32 0, i32 5
  %215 = load ptr, ptr %214, align 8, !tbaa !23
  %216 = load i32, ptr %20, align 4, !tbaa !9
  %217 = load i32, ptr %21, align 4, !tbaa !9
  %218 = load i32, ptr %19, align 4, !tbaa !9
  %219 = icmp sgt i32 %218, 0
  %220 = zext i1 %219 to i32
  call void @blur(ptr noundef %207, ptr noundef %208, ptr noundef %215, i32 noundef %216, i32 noundef %217, ptr noundef null, i32 noundef %220)
  %221 = load i32, ptr %20, align 4, !tbaa !9
  %222 = load i32, ptr %21, align 4, !tbaa !9
  %223 = mul nsw i32 %221, %222
  %224 = sext i32 %223 to i64
  %225 = mul i64 %224, 4
  %226 = call noalias ptr @malloc(i64 noundef %225) #8
  %227 = load ptr, ptr %7, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.dssim_info, ptr %227, i32 0, i32 0
  %229 = load i32, ptr %19, align 4, !tbaa !9
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %228, i64 0, i64 %230
  %232 = getelementptr inbounds %struct.dssim_info_chan, ptr %231, i32 0, i32 6
  store ptr %226, ptr %232, align 8, !tbaa !24
  %233 = load i32, ptr %19, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds ptr, ptr %49, i64 %234
  %236 = load ptr, ptr %235, align 8, !tbaa !5
  %237 = load ptr, ptr %18, align 8, !tbaa !5
  %238 = load ptr, ptr %7, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.dssim_info, ptr %238, i32 0, i32 0
  %240 = load i32, ptr %19, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %239, i64 0, i64 %241
  %243 = getelementptr inbounds %struct.dssim_info_chan, ptr %242, i32 0, i32 6
  %244 = load ptr, ptr %243, align 8, !tbaa !24
  %245 = load i32, ptr %20, align 4, !tbaa !9
  %246 = load i32, ptr %21, align 4, !tbaa !9
  %247 = load i32, ptr %19, align 4, !tbaa !9
  %248 = icmp sgt i32 %247, 0
  %249 = zext i1 %248 to i32
  call void @blur(ptr noundef %236, ptr noundef %237, ptr noundef %244, i32 noundef %245, i32 noundef %246, ptr noundef @square_row, i32 noundef %249)
  %250 = load i32, ptr %19, align 4, !tbaa !9
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds ptr, ptr %49, i64 %251
  %253 = load ptr, ptr %252, align 8, !tbaa !5
  call void @free(ptr noundef %253) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %254

254:                                              ; preds = %170
  %255 = load i32, ptr %19, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %19, align 4, !tbaa !9
  br label %91, !llvm.loop !25

257:                                              ; preds = %97
  %258 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %258) #6
  store i32 0, ptr %6, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %259 = load ptr, ptr %15, align 8
  call void @llvm.stackrestore.p0(ptr %259)
  br label %260

260:                                              ; preds = %257, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %261 = load i32, ptr %6, align 4
  ret i32 %261
}

; Function Attrs: nounwind uwtable
declare hidden void @square_row(ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 }
attributes #4 = { 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 #5 = { nounwind allocsize(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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { nounwind allocsize(0) }

!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, !10, i64 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !10, i64 168}
!15 = !{!"dssim_info", !7, i64 0, !10, i64 168}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!12, !6, i64 8}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = distinct !{!21, !17}
!22 = !{!12, !6, i64 48}
!23 = !{!12, !6, i64 32}
!24 = !{!12, !6, i64 40}
!25 = distinct !{!25, !17}


; 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.dssim_info_chan = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

; Function Attrs: nounwind uwtable
declare hidden void @convert_image(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @blur(ptr noalias noundef, ptr noalias noundef, ptr noalias noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @dssim_set_modified_float_callback(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #3 {
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !11
  %.not = icmp eq i32 %6, %1
  %.not87 = icmp eq i32 %8, %2
  %or.cond = select i1 %.not, i1 %.not87, i1 false
  br i1 %or.cond, label %9, label %108

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  %11 = load i32, ptr %10, align 8, !tbaa !12
  %12 = zext i32 %11 to i64
  %13 = tail call ptr @llvm.stacksave.p0()
  %14 = alloca ptr, i64 %12, align 16
  %15 = load i32, ptr %10, align 8, !tbaa !12
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %9
  %wide.trip.count = zext nneg i32 %15 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %9
  call void @convert_image(ptr noundef nonnull %0, ptr noundef nonnull %14, ptr noundef %3, ptr noundef %4)
  %17 = mul nsw i32 %2, %1
  %18 = sext i32 %17 to i64
  %19 = shl nsw i64 %18, 2
  %20 = call noalias ptr @malloc(i64 noundef %19) #5
  %21 = load i32, ptr %10, align 8, !tbaa !12
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph95, label %._crit_edge96

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %23 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %0, i64 0, i64 %indvars.iv
  %24 = load i32, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %23, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = mul nsw i32 %26, %24
  %28 = sext i32 %27 to i64
  %29 = tail call noalias ptr @calloc(i64 noundef %28, i64 noundef 4) #6
  %30 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv
  store ptr %29, ptr %30, align 8, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge96:                                    ; preds = %._crit_edge92, %._crit_edge
  call void @free(ptr noundef %20) #7
  call void @llvm.stackrestore.p0(ptr %13)
  br label %108

.lr.ph95:                                         ; preds = %._crit_edge, %._crit_edge92
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %._crit_edge92 ], [ 0, %._crit_edge ]
  %31 = getelementptr inbounds [3 x %struct.dssim_info_chan], ptr %0, i64 0, i64 %indvars.iv103
  %32 = load i32, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %31, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !11
  %35 = icmp ne i64 %indvars.iv103, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %.lr.ph95
  %37 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv103
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  call void @blur(ptr noundef %38, ptr noundef %20, ptr noundef %38, i32 noundef %32, i32 noundef %34, ptr noundef null, i32 noundef 0)
  br label %39

39:                                               ; preds = %36, %.lr.ph95
  %40 = mul nsw i32 %34, %32
  %41 = sext i32 %40 to i64
  %42 = shl nsw i64 %41, 2
  %43 = call noalias ptr @malloc(i64 noundef %42) #5
  %44 = ptrtoint ptr %43 to i64
  %45 = getelementptr inbounds i8, ptr %31, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !17
  %47 = ptrtoint ptr %46 to i64
  %48 = icmp sgt i32 %40, 0
  br i1 %48, label %.lr.ph91, label %._crit_edge92

.lr.ph91:                                         ; preds = %39
  %49 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv103
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %wide.trip.count101 = zext nneg i32 %40 to i64
  %min.iters.check = icmp ult i32 %40, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph91
  %indvars.iv98.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph91 ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count101, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv98.prol = phi i64 [ %indvars.iv.next99.prol, %scalar.ph.prol ], [ %indvars.iv98.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %51 = getelementptr inbounds float, ptr %46, i64 %indvars.iv98.prol
  %52 = load float, ptr %51, align 4, !tbaa !18
  %53 = getelementptr inbounds float, ptr %50, i64 %indvars.iv98.prol
  %54 = load float, ptr %53, align 4, !tbaa !18
  %55 = fmul float %52, %54
  %56 = getelementptr inbounds float, ptr %43, i64 %indvars.iv98.prol
  store float %55, ptr %56, align 4, !tbaa !18
  %indvars.iv.next99.prol = add nuw nsw i64 %indvars.iv98.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !20

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

vector.memcheck:                                  ; preds = %.lr.ph91
  %59 = ptrtoint ptr %50 to i64
  %60 = sub i64 %44, %47
  %diff.check = icmp ult i64 %60, 32
  %61 = sub i64 %44, %59
  %diff.check106 = icmp ult i64 %61, 32
  %conflict.rdx = or i1 %diff.check, %diff.check106
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count101, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %62 = getelementptr inbounds float, ptr %46, i64 %index
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %wide.load = load <4 x float>, ptr %62, align 4, !tbaa !18
  %wide.load107 = load <4 x float>, ptr %63, align 4, !tbaa !18
  %64 = getelementptr inbounds float, ptr %50, i64 %index
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %wide.load108 = load <4 x float>, ptr %64, align 4, !tbaa !18
  %wide.load109 = load <4 x float>, ptr %65, align 4, !tbaa !18
  %66 = fmul <4 x float> %wide.load, %wide.load108
  %67 = fmul <4 x float> %wide.load107, %wide.load109
  %68 = getelementptr inbounds float, ptr %43, i64 %index
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  store <4 x float> %66, ptr %68, align 4, !tbaa !18
  store <4 x float> %67, ptr %69, align 4, !tbaa !18
  %index.next = add nuw i64 %index, 8
  %70 = icmp eq i64 %index.next, %n.vec
  br i1 %70, label %middle.block, label %vector.body, !llvm.loop !22

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

._crit_edge92:                                    ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %39
  %71 = call noalias ptr @malloc(i64 noundef %42) #5
  %72 = getelementptr inbounds i8, ptr %31, i64 48
  store ptr %71, ptr %72, align 8, !tbaa !25
  %73 = zext i1 %35 to i32
  call void @blur(ptr noundef %43, ptr noundef %20, ptr noundef %71, i32 noundef %32, i32 noundef %34, ptr noundef null, i32 noundef %73)
  %74 = getelementptr inbounds i8, ptr %31, i64 32
  store ptr %43, ptr %74, align 8, !tbaa !26
  %75 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv103
  %76 = load ptr, ptr %75, align 8, !tbaa !14
  call void @blur(ptr noundef %76, ptr noundef %20, ptr noundef %43, i32 noundef %32, i32 noundef %34, ptr noundef null, i32 noundef %73)
  %77 = call noalias ptr @malloc(i64 noundef %42) #5
  %78 = getelementptr inbounds i8, ptr %31, i64 40
  store ptr %77, ptr %78, align 8, !tbaa !27
  %79 = load ptr, ptr %75, align 8, !tbaa !14
  call void @blur(ptr noundef %79, ptr noundef %20, ptr noundef %77, i32 noundef %32, i32 noundef %34, ptr noundef nonnull @square_row, i32 noundef %73)
  %80 = load ptr, ptr %75, align 8, !tbaa !14
  call void @free(ptr noundef %80) #7
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %81 = load i32, ptr %10, align 8, !tbaa !12
  %82 = sext i32 %81 to i64
  %83 = icmp slt i64 %indvars.iv.next104, %82
  br i1 %83, label %.lr.ph95, label %._crit_edge96, !llvm.loop !28

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv98 = phi i64 [ %indvars.iv.next99.3, %scalar.ph ], [ %indvars.iv98.unr, %scalar.ph.prol.loopexit ]
  %84 = getelementptr inbounds float, ptr %46, i64 %indvars.iv98
  %85 = load float, ptr %84, align 4, !tbaa !18
  %86 = getelementptr inbounds float, ptr %50, i64 %indvars.iv98
  %87 = load float, ptr %86, align 4, !tbaa !18
  %88 = fmul float %85, %87
  %89 = getelementptr inbounds float, ptr %43, i64 %indvars.iv98
  store float %88, ptr %89, align 4, !tbaa !18
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %90 = getelementptr inbounds float, ptr %46, i64 %indvars.iv.next99
  %91 = load float, ptr %90, align 4, !tbaa !18
  %92 = getelementptr inbounds float, ptr %50, i64 %indvars.iv.next99
  %93 = load float, ptr %92, align 4, !tbaa !18
  %94 = fmul float %91, %93
  %95 = getelementptr inbounds float, ptr %43, i64 %indvars.iv.next99
  store float %94, ptr %95, align 4, !tbaa !18
  %indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 2
  %96 = getelementptr inbounds float, ptr %46, i64 %indvars.iv.next99.1
  %97 = load float, ptr %96, align 4, !tbaa !18
  %98 = getelementptr inbounds float, ptr %50, i64 %indvars.iv.next99.1
  %99 = load float, ptr %98, align 4, !tbaa !18
  %100 = fmul float %97, %99
  %101 = getelementptr inbounds float, ptr %43, i64 %indvars.iv.next99.1
  store float %100, ptr %101, align 4, !tbaa !18
  %indvars.iv.next99.2 = add nuw nsw i64 %indvars.iv98, 3
  %102 = getelementptr inbounds float, ptr %46, i64 %indvars.iv.next99.2
  %103 = load float, ptr %102, align 4, !tbaa !18
  %104 = getelementptr inbounds float, ptr %50, i64 %indvars.iv.next99.2
  %105 = load float, ptr %104, align 4, !tbaa !18
  %106 = fmul float %103, %105
  %107 = getelementptr inbounds float, ptr %43, i64 %indvars.iv.next99.2
  store float %106, ptr %107, align 4, !tbaa !18
  %indvars.iv.next99.3 = add nuw nsw i64 %indvars.iv98, 4
  %exitcond102.not.3 = icmp eq i64 %indvars.iv.next99.3, %wide.trip.count101
  br i1 %exitcond102.not.3, label %._crit_edge92, label %scalar.ph, !llvm.loop !29

108:                                              ; preds = %5, %._crit_edge96
  %.082 = phi i32 [ 0, %._crit_edge96 ], [ 1, %5 ]
  ret i32 %.082
}

; Function Attrs: nounwind uwtable
declare hidden void @square_row(ptr noundef, i32 noundef) #3

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { 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 #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #6 = { nounwind allocsize(0,1) }
attributes #7 = { 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, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!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 = !{!13, !7, i64 168}
!13 = !{!"dssim_info", !8, i64 0, !7, i64 168}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !10, i64 8}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !16, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = !{!6, !10, i64 48}
!26 = !{!6, !10, i64 32}
!27 = !{!6, !10, i64 40}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16, !23}


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