; LLVM IR from ljm941004/HYPERCV_PUBLIC :: modules/algorithm/src (cluster)

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

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @hypercv_k_means(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %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 i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %4
  br label %33

29:                                               ; preds = %4
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #6
  unreachable

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

36:                                               ; preds = %33
  br label %41

37:                                               ; preds = %33
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #6
  unreachable

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

44:                                               ; preds = %41
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds i64, ptr %45, i64 -2
  %47 = load i64, ptr %46, align 8, !tbaa !11
  br label %49

48:                                               ; preds = %41
  br label %49

49:                                               ; preds = %48, %44
  %50 = phi i64 [ %47, %44 ], [ 0, %48 ]
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = icmp eq i64 %50, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %49
  br label %59

55:                                               ; preds = %49
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #6
  unreachable

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 4, !tbaa !13
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %67

64:                                               ; preds = %59
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = call ptr @sm_rgb2gray(ptr noundef %65, i32 noundef 0)
  store ptr %66, ptr %9, align 8, !tbaa !5
  br label %69

67:                                               ; preds = %59
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %68, ptr %9, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %67, %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %71, align 8, !tbaa !15
  store i32 %72, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 4, !tbaa !16
  store i32 %75, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = mul i64 %77, 8
  %79 = call noalias ptr @malloc(i64 noundef %78) #8
  store ptr %79, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = mul i64 %81, 4
  %83 = call noalias ptr @malloc(i64 noundef %82) #8
  store ptr %83, ptr %13, align 8, !tbaa !5
  %84 = call i64 @time(ptr noundef null) #7
  %85 = trunc i64 %84 to i32
  call void @srand(i32 noundef %85) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %124, %69
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %127

91:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %92 = call i32 @rand() #7
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = srem i32 %92, %93
  store i32 %94, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %95 = call i32 @rand() #7
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = srem i32 %95, %96
  store i32 %97, ptr %16, align 4, !tbaa !9
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load i32, ptr %14, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.point, ptr %99, i64 %101
  %103 = getelementptr inbounds %struct.point, ptr %102, i32 0, i32 0
  store i32 %98, ptr %103, align 4, !tbaa !17
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = load i32, ptr %14, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.point, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.point, ptr %108, i32 0, i32 1
  store i32 %104, ptr %109, align 4, !tbaa !19
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = load i32, ptr %14, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.point, ptr %110, i64 %112
  %114 = getelementptr inbounds %struct.point, ptr %113, i32 0, i32 0
  store i32 0, ptr %114, align 4, !tbaa !17
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.point, ptr %115, i64 %117
  %119 = getelementptr inbounds %struct.point, ptr %118, i32 0, i32 1
  store i32 0, ptr %119, align 4, !tbaa !19
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i32, ptr %120, i64 %122
  store i32 0, ptr %123, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %124

124:                                              ; preds = %91
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %14, align 4, !tbaa !9
  br label %86, !llvm.loop !20

127:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.SIMPLE_MAT, ptr %128, i32 0, i32 5
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  store ptr %130, ptr %17, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %353, %127
  br label %132

132:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %222, %132
  %134 = load i32, ptr %19, align 4, !tbaa !9
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %133
  store i32 7, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %225

138:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %218, %138
  %140 = load i32, ptr %21, align 4, !tbaa !9
  %141 = load i32, ptr %11, align 4, !tbaa !9
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 10, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %221

144:                                              ; preds = %139
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = load i32, ptr %19, align 4, !tbaa !9
  %147 = load i32, ptr %11, align 4, !tbaa !9
  %148 = mul nsw i32 %146, %147
  %149 = load i32, ptr %21, align 4, !tbaa !9
  %150 = add nsw i32 %148, %149
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %145, i64 %151
  %153 = load i8, ptr %152, align 1, !tbaa !23
  %154 = zext i8 %153 to i32
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %217

156:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %157 = load i32, ptr %10, align 4, !tbaa !9
  %158 = load i32, ptr %10, align 4, !tbaa !9
  %159 = mul nsw i32 %157, %158
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = load i32, ptr %11, align 4, !tbaa !9
  %162 = mul nsw i32 %160, %161
  %163 = add nsw i32 %159, %162
  store i32 %163, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %191, %156
  %165 = load i32, ptr %24, align 4, !tbaa !9
  %166 = load i32, ptr %7, align 4, !tbaa !9
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %169, label %168

168:                                              ; preds = %164
  store i32 13, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %194

169:                                              ; preds = %164
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load i32, ptr %24, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds %struct.point, ptr %170, i64 %172
  %174 = load i32, ptr %19, align 4, !tbaa !9
  %175 = load i32, ptr %21, align 4, !tbaa !9
  %176 = load i64, ptr %173, align 4
  %177 = call i32 @distance(i64 %176, i32 noundef %174, i32 noundef %175)
  %178 = load i32, ptr %23, align 4, !tbaa !9
  %179 = icmp slt i32 %177, %178
  br i1 %179, label %180, label %190

180:                                              ; preds = %169
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = load i32, ptr %24, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds %struct.point, ptr %181, i64 %183
  %185 = load i32, ptr %19, align 4, !tbaa !9
  %186 = load i32, ptr %21, align 4, !tbaa !9
  %187 = load i64, ptr %184, align 4
  %188 = call i32 @distance(i64 %187, i32 noundef %185, i32 noundef %186)
  store i32 %188, ptr %23, align 4, !tbaa !9
  %189 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %189, ptr %22, align 4, !tbaa !9
  br label %190

190:                                              ; preds = %180, %169
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %24, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %24, align 4, !tbaa !9
  br label %164, !llvm.loop !24

194:                                              ; preds = %168
  %195 = load i32, ptr %21, align 4, !tbaa !9
  %196 = load ptr, ptr %12, align 8, !tbaa !5
  %197 = load i32, ptr %22, align 4, !tbaa !9
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds %struct.point, ptr %196, i64 %198
  %200 = getelementptr inbounds %struct.point, ptr %199, i32 0, i32 0
  %201 = load i32, ptr %200, align 4, !tbaa !17
  %202 = add nsw i32 %201, %195
  store i32 %202, ptr %200, align 4, !tbaa !17
  %203 = load i32, ptr %19, align 4, !tbaa !9
  %204 = load ptr, ptr %12, align 8, !tbaa !5
  %205 = load i32, ptr %22, align 4, !tbaa !9
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds %struct.point, ptr %204, i64 %206
  %208 = getelementptr inbounds %struct.point, ptr %207, i32 0, i32 1
  %209 = load i32, ptr %208, align 4, !tbaa !19
  %210 = add nsw i32 %209, %203
  store i32 %210, ptr %208, align 4, !tbaa !19
  %211 = load ptr, ptr %13, align 8, !tbaa !5
  %212 = load i32, ptr %22, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds i32, ptr %211, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !9
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %214, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %217

217:                                              ; preds = %194, %144
  br label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %21, align 4, !tbaa !9
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %21, align 4, !tbaa !9
  br label %139, !llvm.loop !25

221:                                              ; preds = %143
  br label %222

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

225:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %343, %225
  %227 = load i32, ptr %25, align 4, !tbaa !9
  %228 = load i32, ptr %7, align 4, !tbaa !9
  %229 = icmp slt i32 %227, %228
  br i1 %229, label %231, label %230

230:                                              ; preds = %226
  store i32 16, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %346

231:                                              ; preds = %226
  %232 = load ptr, ptr %13, align 8, !tbaa !5
  %233 = load i32, ptr %25, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds i32, ptr %232, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !9
  %237 = icmp ne i32 %236, 0
  br i1 %237, label %238, label %273

238:                                              ; preds = %231
  %239 = load ptr, ptr %12, align 8, !tbaa !5
  %240 = load i32, ptr %25, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds %struct.point, ptr %239, i64 %241
  %243 = getelementptr inbounds %struct.point, ptr %242, i32 0, i32 0
  %244 = load i32, ptr %243, align 4, !tbaa !17
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  %246 = load i32, ptr %25, align 4, !tbaa !9
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds i32, ptr %245, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !9
  %250 = sdiv i32 %244, %249
  %251 = load ptr, ptr %12, align 8, !tbaa !5
  %252 = load i32, ptr %25, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds %struct.point, ptr %251, i64 %253
  %255 = getelementptr inbounds %struct.point, ptr %254, i32 0, i32 0
  store i32 %250, ptr %255, align 4, !tbaa !17
  %256 = load ptr, ptr %12, align 8, !tbaa !5
  %257 = load i32, ptr %25, align 4, !tbaa !9
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds %struct.point, ptr %256, i64 %258
  %260 = getelementptr inbounds %struct.point, ptr %259, i32 0, i32 1
  %261 = load i32, ptr %260, align 4, !tbaa !19
  %262 = load ptr, ptr %13, align 8, !tbaa !5
  %263 = load i32, ptr %25, align 4, !tbaa !9
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds i32, ptr %262, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !9
  %267 = sdiv i32 %261, %266
  %268 = load ptr, ptr %12, align 8, !tbaa !5
  %269 = load i32, ptr %25, align 4, !tbaa !9
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds %struct.point, ptr %268, i64 %270
  %272 = getelementptr inbounds %struct.point, ptr %271, i32 0, i32 1
  store i32 %267, ptr %272, align 4, !tbaa !19
  br label %273

273:                                              ; preds = %238, %231
  %274 = load ptr, ptr %12, align 8, !tbaa !5
  %275 = load i32, ptr %25, align 4, !tbaa !9
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds %struct.point, ptr %274, i64 %276
  %278 = getelementptr inbounds %struct.point, ptr %277, i32 0, i32 0
  %279 = load i32, ptr %278, align 4, !tbaa !17
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = load i32, ptr %25, align 4, !tbaa !9
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds %struct.point, ptr %280, i64 %282
  %284 = getelementptr inbounds %struct.point, ptr %283, i32 0, i32 0
  %285 = load i32, ptr %284, align 4, !tbaa !17
  %286 = sub nsw i32 %279, %285
  %287 = load i32, ptr %8, align 4, !tbaa !9
  %288 = icmp sgt i32 %286, %287
  br i1 %288, label %305, label %289

289:                                              ; preds = %273
  %290 = load ptr, ptr %12, align 8, !tbaa !5
  %291 = load i32, ptr %25, align 4, !tbaa !9
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds %struct.point, ptr %290, i64 %292
  %294 = getelementptr inbounds %struct.point, ptr %293, i32 0, i32 1
  %295 = load i32, ptr %294, align 4, !tbaa !19
  %296 = load ptr, ptr %6, align 8, !tbaa !5
  %297 = load i32, ptr %25, align 4, !tbaa !9
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds %struct.point, ptr %296, i64 %298
  %300 = getelementptr inbounds %struct.point, ptr %299, i32 0, i32 1
  %301 = load i32, ptr %300, align 4, !tbaa !19
  %302 = sub nsw i32 %295, %301
  %303 = load i32, ptr %8, align 4, !tbaa !9
  %304 = icmp sgt i32 %302, %303
  br i1 %304, label %305, label %306

305:                                              ; preds = %289, %273
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %306

306:                                              ; preds = %305, %289
  %307 = load ptr, ptr %12, align 8, !tbaa !5
  %308 = load i32, ptr %25, align 4, !tbaa !9
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds %struct.point, ptr %307, i64 %309
  %311 = getelementptr inbounds %struct.point, ptr %310, i32 0, i32 0
  %312 = load i32, ptr %311, align 4, !tbaa !17
  %313 = load ptr, ptr %6, align 8, !tbaa !5
  %314 = load i32, ptr %25, align 4, !tbaa !9
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds %struct.point, ptr %313, i64 %315
  %317 = getelementptr inbounds %struct.point, ptr %316, i32 0, i32 0
  store i32 %312, ptr %317, align 4, !tbaa !17
  %318 = load ptr, ptr %12, align 8, !tbaa !5
  %319 = load i32, ptr %25, align 4, !tbaa !9
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds %struct.point, ptr %318, i64 %320
  %322 = getelementptr inbounds %struct.point, ptr %321, i32 0, i32 1
  %323 = load i32, ptr %322, align 4, !tbaa !19
  %324 = load ptr, ptr %6, align 8, !tbaa !5
  %325 = load i32, ptr %25, align 4, !tbaa !9
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds %struct.point, ptr %324, i64 %326
  %328 = getelementptr inbounds %struct.point, ptr %327, i32 0, i32 1
  store i32 %323, ptr %328, align 4, !tbaa !19
  %329 = load ptr, ptr %12, align 8, !tbaa !5
  %330 = load i32, ptr %25, align 4, !tbaa !9
  %331 = sext i32 %330 to i64
  %332 = getelementptr inbounds %struct.point, ptr %329, i64 %331
  %333 = getelementptr inbounds %struct.point, ptr %332, i32 0, i32 0
  store i32 0, ptr %333, align 4, !tbaa !17
  %334 = load ptr, ptr %12, align 8, !tbaa !5
  %335 = load i32, ptr %25, align 4, !tbaa !9
  %336 = sext i32 %335 to i64
  %337 = getelementptr inbounds %struct.point, ptr %334, i64 %336
  %338 = getelementptr inbounds %struct.point, ptr %337, i32 0, i32 1
  store i32 0, ptr %338, align 4, !tbaa !19
  %339 = load ptr, ptr %13, align 8, !tbaa !5
  %340 = load i32, ptr %25, align 4, !tbaa !9
  %341 = sext i32 %340 to i64
  %342 = getelementptr inbounds i32, ptr %339, i64 %341
  store i32 0, ptr %342, align 4, !tbaa !9
  br label %343

343:                                              ; preds = %306
  %344 = load i32, ptr %25, align 4, !tbaa !9
  %345 = add nsw i32 %344, 1
  store i32 %345, ptr %25, align 4, !tbaa !9
  br label %226, !llvm.loop !27

346:                                              ; preds = %230
  %347 = load i32, ptr %18, align 4, !tbaa !9
  %348 = icmp eq i32 %347, 0
  br i1 %348, label %349, label %350

349:                                              ; preds = %346
  store i32 6, ptr %20, align 4
  br label %351

350:                                              ; preds = %346
  store i32 0, ptr %20, align 4
  br label %351

351:                                              ; preds = %350, %349
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %352 = load i32, ptr %20, align 4
  switch i32 %352, label %357 [
    i32 0, label %353
    i32 6, label %354
  ]

353:                                              ; preds = %351
  br label %131

354:                                              ; preds = %351
  %355 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %355) #7
  %356 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %356) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void

357:                                              ; preds = %351
  unreachable
}

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

declare ptr @sm_rgb2gray(ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #5

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #5

; Function Attrs: nounwind
declare i32 @rand() #5

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

; Function Attrs: nounwind uwtable
declare hidden i32 @distance(i64, i32 noundef, i32 noundef) #0

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

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 = { "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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { noreturn nounwind }
attributes #7 = { nounwind }
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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 12}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24}
!15 = !{!14, !10, i64 0}
!16 = !{!14, !10, i64 4}
!17 = !{!18, !10, i64 0}
!18 = !{!"point", !10, i64 0, !10, i64 4}
!19 = !{!18, !10, i64 4}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !6, i64 24}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}
!27 = distinct !{!27, !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"

%struct.point = type { i32, i32 }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @hypercv_k_means(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %5, label %9

5:                                                ; preds = %4
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

9:                                                ; preds = %4
  %10 = icmp sgt i32 %2, 0
  br i1 %10, label %15, label %11

11:                                               ; preds = %9
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

15:                                               ; preds = %9
  %.not128 = icmp eq ptr %1, null
  br i1 %.not128, label %19, label %16

16:                                               ; preds = %15
  %17 = getelementptr inbounds i8, ptr %1, i64 -16
  %18 = load i64, ptr %17, align 8, !tbaa !5
  br label %19

19:                                               ; preds = %15, %16
  %20 = phi i64 [ %18, %16 ], [ 0, %15 ]
  %21 = zext nneg i32 %2 to i64
  %22 = icmp eq i64 %20, %21
  br i1 %22, label %27, label %23

23:                                               ; preds = %19
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

27:                                               ; preds = %19
  %28 = getelementptr inbounds i8, ptr %0, i64 12
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %.not129 = icmp eq i32 %29, 1
  br i1 %.not129, label %.lr.ph.preheader, label %30

30:                                               ; preds = %27
  %31 = tail call ptr @sm_rgb2gray(ptr noundef nonnull %0, i32 noundef 0) #9
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %30, %27
  %.0118 = phi ptr [ %31, %30 ], [ %0, %27 ]
  %32 = load i32, ptr %0, align 8, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %0, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = shl nuw nsw i64 %20, 3
  %36 = tail call noalias ptr @malloc(i64 noundef %35) #10
  %37 = shl nuw nsw i64 %20, 2
  %38 = tail call noalias ptr @malloc(i64 noundef %37) #10
  %39 = tail call i64 @time(ptr noundef null) #9
  %40 = trunc i64 %39 to i32
  tail call void @srand(i32 noundef %40) #9
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %41 = getelementptr inbounds i8, ptr %.0118, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = icmp sgt i32 %32, 0
  %44 = icmp sgt i32 %34, 0
  %45 = mul nsw i32 %32, %32
  %46 = mul nsw i32 %34, %34
  %47 = add nuw nsw i32 %46, %45
  %smax185 = tail call i32 @llvm.smax.i32(i32 %2, i32 1)
  br i1 %43, label %.preheader.lr.ph.us.preheader, label %.preheader132.us163.preheader

.preheader.lr.ph.us.preheader:                    ; preds = %._crit_edge
  %48 = zext i32 %34 to i64
  %wide.trip.count196 = zext nneg i32 %32 to i64
  %wide.trip.count186 = zext nneg i32 %smax185 to i64
  %wide.trip.count202 = zext nneg i32 %smax185 to i64
  br label %.preheader.lr.ph.us

.preheader.lr.ph.us:                              ; preds = %.preheader.lr.ph.us.preheader, %._crit_edge152.us
  br i1 %44, label %.preheader.us.us.us, label %.lr.ph151.us.preheader

.lr.ph151.us.preheader:                           ; preds = %._crit_edge142.split.us.us.us.us, %.preheader.lr.ph.us
  br label %.lr.ph151.us

._crit_edge152.us:                                ; preds = %._crit_edge213
  %49 = icmp eq i32 %.1117.us, 0
  br i1 %49, label %.split162.us, label %.preheader.lr.ph.us

.lr.ph151.us:                                     ; preds = %.lr.ph151.us.preheader, %._crit_edge213
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %._crit_edge213 ], [ 0, %.lr.ph151.us.preheader ]
  %.0116149.us = phi i32 [ %.1117.us, %._crit_edge213 ], [ 0, %.lr.ph151.us.preheader ]
  %50 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv198
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %.not130.us = icmp eq i32 %51, 0
  %.phi.trans.insert207 = getelementptr inbounds %struct.point, ptr %36, i64 %indvars.iv198
  %.pre208 = load i32, ptr %.phi.trans.insert207, align 4, !tbaa !17
  br i1 %.not130.us, label %.lr.ph151.us._crit_edge, label %52

52:                                               ; preds = %.lr.ph151.us
  %53 = sdiv i32 %.pre208, %51
  %54 = getelementptr inbounds i8, ptr %.phi.trans.insert207, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %56 = sdiv i32 %55, %51
  store i32 %56, ptr %54, align 4, !tbaa !19
  br label %.lr.ph151.us._crit_edge

.lr.ph151.us._crit_edge:                          ; preds = %.lr.ph151.us, %52
  %57 = phi i32 [ %53, %52 ], [ %.pre208, %.lr.ph151.us ]
  %58 = getelementptr inbounds %struct.point, ptr %36, i64 %indvars.iv198
  %59 = getelementptr inbounds %struct.point, ptr %1, i64 %indvars.iv198
  %60 = load i32, ptr %59, align 4, !tbaa !17
  %61 = sub nsw i32 %57, %60
  %62 = icmp sgt i32 %61, %3
  %.phi.trans.insert209.phi.trans.insert = getelementptr inbounds i8, ptr %58, i64 4
  %.pre210.pre = load i32, ptr %.phi.trans.insert209.phi.trans.insert, align 4, !tbaa !19
  br i1 %62, label %._crit_edge213, label %63

63:                                               ; preds = %.lr.ph151.us._crit_edge
  %64 = getelementptr inbounds i8, ptr %59, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !19
  %66 = sub nsw i32 %.pre210.pre, %65
  %67 = icmp sgt i32 %66, %3
  %spec.select = select i1 %67, i32 1, i32 %.0116149.us
  br label %._crit_edge213

._crit_edge213:                                   ; preds = %63, %.lr.ph151.us._crit_edge
  %.1117.us = phi i32 [ 1, %.lr.ph151.us._crit_edge ], [ %spec.select, %63 ]
  store i32 %57, ptr %59, align 4, !tbaa !17
  %68 = getelementptr inbounds i8, ptr %58, i64 4
  %69 = getelementptr inbounds i8, ptr %59, i64 4
  store i32 %.pre210.pre, ptr %69, align 4, !tbaa !19
  store i32 0, ptr %58, align 4, !tbaa !17
  store i32 0, ptr %68, align 4, !tbaa !19
  store i32 0, ptr %50, align 4, !tbaa !16
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %exitcond203.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count202
  br i1 %exitcond203.not, label %._crit_edge152.us, label %.lr.ph151.us, !llvm.loop !20

.preheader.us.us.us:                              ; preds = %.preheader.lr.ph.us, %._crit_edge142.split.us.us.us.us
  %indvars.iv193 = phi i64 [ %indvars.iv.next194, %._crit_edge142.split.us.us.us.us ], [ 0, %.preheader.lr.ph.us ]
  %70 = mul nuw nsw i64 %indvars.iv193, %48
  %invariant.gep = getelementptr inbounds i8, ptr %42, i64 %70
  %71 = trunc nuw nsw i64 %indvars.iv193 to i32
  br label %72

72:                                               ; preds = %84, %.preheader.us.us.us
  %indvars.iv188 = phi i64 [ %indvars.iv.next189, %84 ], [ 0, %.preheader.us.us.us ]
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv188
  %73 = load i8, ptr %gep, align 1, !tbaa !22
  %.not131.us.us.us.us = icmp eq i8 %73, 0
  br i1 %.not131.us.us.us.us, label %84, label %.lr.ph138.us.us.us.us.preheader

.lr.ph138.us.us.us.us.preheader:                  ; preds = %72
  %74 = trunc nuw nsw i64 %indvars.iv188 to i32
  br label %.lr.ph138.us.us.us.us

.lr.ph138.us.us.us.us:                            ; preds = %.lr.ph138.us.us.us.us.preheader, %83
  %indvars.iv182 = phi i64 [ 0, %.lr.ph138.us.us.us.us.preheader ], [ %indvars.iv.next183, %83 ]
  %.0110135.us.us.us.us = phi i32 [ %47, %.lr.ph138.us.us.us.us.preheader ], [ %.1.us.us.us.us, %83 ]
  %.0111134.us.us.us.us = phi i32 [ 0, %.lr.ph138.us.us.us.us.preheader ], [ %.1112.us.us.us.us, %83 ]
  %75 = getelementptr inbounds %struct.point, ptr %1, i64 %indvars.iv182
  %76 = load i64, ptr %75, align 4
  %77 = tail call i32 @distance(i64 %76, i32 noundef %71, i32 noundef %74)
  %78 = icmp slt i32 %77, %.0110135.us.us.us.us
  br i1 %78, label %79, label %83

79:                                               ; preds = %.lr.ph138.us.us.us.us
  %80 = load i64, ptr %75, align 4
  %81 = tail call i32 @distance(i64 %80, i32 noundef %71, i32 noundef %74)
  %82 = trunc nuw nsw i64 %indvars.iv182 to i32
  br label %83

83:                                               ; preds = %79, %.lr.ph138.us.us.us.us
  %.1112.us.us.us.us = phi i32 [ %82, %79 ], [ %.0111134.us.us.us.us, %.lr.ph138.us.us.us.us ]
  %.1.us.us.us.us = phi i32 [ %81, %79 ], [ %.0110135.us.us.us.us, %.lr.ph138.us.us.us.us ]
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %exitcond187.not = icmp eq i64 %indvars.iv.next183, %wide.trip.count186
  br i1 %exitcond187.not, label %._crit_edge139.us.us.us.us, label %.lr.ph138.us.us.us.us, !llvm.loop !23

84:                                               ; preds = %._crit_edge139.us.us.us.us, %72
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %exitcond192.not = icmp eq i64 %indvars.iv.next189, %48
  br i1 %exitcond192.not, label %._crit_edge142.split.us.us.us.us, label %72, !llvm.loop !24

._crit_edge139.us.us.us.us:                       ; preds = %83
  %85 = sext i32 %.1112.us.us.us.us to i64
  %86 = getelementptr inbounds %struct.point, ptr %36, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !17
  %88 = add nsw i32 %87, %74
  store i32 %88, ptr %86, align 4, !tbaa !17
  %89 = getelementptr inbounds i8, ptr %86, i64 4
  %90 = load i32, ptr %89, align 4, !tbaa !19
  %91 = add nsw i32 %90, %71
  store i32 %91, ptr %89, align 4, !tbaa !19
  %92 = getelementptr inbounds i32, ptr %38, i64 %85
  %93 = load i32, ptr %92, align 4, !tbaa !16
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %92, align 4, !tbaa !16
  br label %84

._crit_edge142.split.us.us.us.us:                 ; preds = %84
  %indvars.iv.next194 = add nuw nsw i64 %indvars.iv193, 1
  %exitcond197.not = icmp eq i64 %indvars.iv.next194, %wide.trip.count196
  br i1 %exitcond197.not, label %.lr.ph151.us.preheader, label %.preheader.us.us.us, !llvm.loop !25

.preheader132.us163.preheader:                    ; preds = %._crit_edge
  %wide.trip.count180 = zext nneg i32 %smax185 to i64
  br label %.preheader132.us163

.preheader132.us163:                              ; preds = %.preheader132.us163.backedge, %.preheader132.us163.preheader
  %indvars.iv176 = phi i64 [ 0, %.preheader132.us163.preheader ], [ %indvars.iv176.be, %.preheader132.us163.backedge ]
  %.0116149.us166 = phi i32 [ 0, %.preheader132.us163.preheader ], [ %.0116149.us166.be, %.preheader132.us163.backedge ]
  %95 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv176
  %96 = load i32, ptr %95, align 4, !tbaa !16
  %.not130.us167 = icmp eq i32 %96, 0
  %.phi.trans.insert = getelementptr inbounds %struct.point, ptr %36, i64 %indvars.iv176
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !17
  br i1 %.not130.us167, label %._crit_edge204, label %97

97:                                               ; preds = %.preheader132.us163
  %98 = sdiv i32 %.pre, %96
  %99 = getelementptr inbounds i8, ptr %.phi.trans.insert, i64 4
  %100 = load i32, ptr %99, align 4, !tbaa !19
  %101 = sdiv i32 %100, %96
  store i32 %101, ptr %99, align 4, !tbaa !19
  br label %._crit_edge204

._crit_edge204:                                   ; preds = %.preheader132.us163, %97
  %102 = phi i32 [ %98, %97 ], [ %.pre, %.preheader132.us163 ]
  %103 = getelementptr inbounds %struct.point, ptr %36, i64 %indvars.iv176
  %104 = getelementptr inbounds %struct.point, ptr %1, i64 %indvars.iv176
  %105 = load i32, ptr %104, align 4, !tbaa !17
  %106 = sub nsw i32 %102, %105
  %107 = icmp sgt i32 %106, %3
  %.phi.trans.insert205.phi.trans.insert = getelementptr inbounds i8, ptr %103, i64 4
  %.pre206.pre = load i32, ptr %.phi.trans.insert205.phi.trans.insert, align 4, !tbaa !19
  br i1 %107, label %._crit_edge211, label %108

108:                                              ; preds = %._crit_edge204
  %109 = getelementptr inbounds i8, ptr %104, i64 4
  %110 = load i32, ptr %109, align 4, !tbaa !19
  %111 = sub nsw i32 %.pre206.pre, %110
  %112 = icmp sgt i32 %111, %3
  %spec.select217 = select i1 %112, i32 1, i32 %.0116149.us166
  br label %._crit_edge211

._crit_edge211:                                   ; preds = %108, %._crit_edge204
  %.1117.us168 = phi i32 [ 1, %._crit_edge204 ], [ %spec.select217, %108 ]
  store i32 %102, ptr %104, align 4, !tbaa !17
  %113 = getelementptr inbounds i8, ptr %103, i64 4
  %114 = getelementptr inbounds i8, ptr %104, i64 4
  store i32 %.pre206.pre, ptr %114, align 4, !tbaa !19
  store i32 0, ptr %103, align 4, !tbaa !17
  store i32 0, ptr %113, align 4, !tbaa !19
  store i32 0, ptr %95, align 4, !tbaa !16
  %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
  %exitcond181.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count180
  br i1 %exitcond181.not, label %._crit_edge152.us170, label %.preheader132.us163.backedge

.preheader132.us163.backedge:                     ; preds = %._crit_edge211, %._crit_edge152.us170
  %indvars.iv176.be = phi i64 [ %indvars.iv.next177, %._crit_edge211 ], [ 0, %._crit_edge152.us170 ]
  %.0116149.us166.be = phi i32 [ %.1117.us168, %._crit_edge211 ], [ 0, %._crit_edge152.us170 ]
  br label %.preheader132.us163, !llvm.loop !20

._crit_edge152.us170:                             ; preds = %._crit_edge211
  %115 = icmp eq i32 %.1117.us168, 0
  br i1 %115, label %.split162.us, label %.preheader132.us163.backedge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %116 = tail call i32 @rand() #9
  %117 = srem i32 %116, %34
  %118 = tail call i32 @rand() #9
  %119 = srem i32 %118, %32
  %120 = getelementptr inbounds %struct.point, ptr %1, i64 %indvars.iv
  store i32 %117, ptr %120, align 4, !tbaa !17
  %121 = getelementptr inbounds i8, ptr %120, i64 4
  store i32 %119, ptr %121, align 4, !tbaa !19
  %122 = getelementptr inbounds %struct.point, ptr %36, i64 %indvars.iv
  store i32 0, ptr %122, align 4, !tbaa !17
  %123 = getelementptr inbounds i8, ptr %122, i64 4
  store i32 0, ptr %123, align 4, !tbaa !19
  %124 = getelementptr inbounds i32, ptr %38, i64 %indvars.iv
  store i32 0, ptr %124, align 4, !tbaa !16
  %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 !26

.split162.us:                                     ; preds = %._crit_edge152.us170, %._crit_edge152.us
  tail call void @free(ptr noundef nonnull %36) #9
  tail call void @free(ptr noundef nonnull %38) #9
  ret void
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

declare ptr @sm_rgb2gray(ptr noundef, i32 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
declare void @srand(i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden i32 @distance(i64, i32 noundef, i32 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 #6

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

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


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