; LLVM IR from casensiom/fast-image-processing :: src (hough)

; 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.SPolar = type { float, float }
%struct.SHoughWorkspace = type { i32, i32, double, i32, i32, ptr, i32, i32, ptr, i32, ptr, ptr }
%struct.SCollisionPoint = type { i32, i32 }

@.str = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @HoughLinesStandard(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca %struct.SPolar, align 4
  %32 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store i32 %5, ptr %13, align 4, !tbaa !9
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.SHoughWorkspace, ptr %33, i32 0, i32 5
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  store ptr %35, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.SHoughWorkspace, ptr %36, i32 0, i32 10
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  store ptr %38, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.SHoughWorkspace, ptr %39, i32 0, i32 11
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  store ptr %41, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = udiv i32 %42, 2
  store i32 %43, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %44 = load i32, ptr %10, align 4, !tbaa !9
  %45 = udiv i32 %44, 2
  store i32 %45, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SHoughWorkspace, ptr %46, i32 0, i32 2
  %48 = load double, ptr %47, align 8, !tbaa !16
  store double %48, ptr %24, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.SHoughWorkspace, ptr %49, i32 0, i32 3
  %51 = load i32, ptr %50, align 8, !tbaa !18
  %52 = uitofp i32 %51 to double
  store double %52, ptr %25, align 8, !tbaa !17
  %53 = load ptr, ptr %14, align 8, !tbaa !5
  call void @reset_workspace_hough(ptr noundef %53)
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %127, %7
  %55 = load i32, ptr %16, align 4, !tbaa !9
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp ult i32 %55, %56
  br i1 %57, label %58, label %130

58:                                               ; preds = %54
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %123, %58
  %60 = load i32, ptr %15, align 4, !tbaa !9
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = icmp ult i32 %60, %61
  br i1 %62, label %63, label %126

63:                                               ; preds = %59
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i8, ptr %64, align 1, !tbaa !19
  %66 = zext i8 %65 to i32
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %68, label %120

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = load i32, ptr %22, align 4, !tbaa !9
  %71 = sub nsw i32 %69, %70
  %72 = sitofp i32 %71 to double
  store double %72, ptr %26, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %73 = load i32, ptr %16, align 4, !tbaa !9
  %74 = load i32, ptr %23, align 4, !tbaa !9
  %75 = sub nsw i32 %73, %74
  %76 = sitofp i32 %75 to double
  store double %76, ptr %27, align 8, !tbaa !17
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %116, %68
  %78 = load i32, ptr %18, align 4, !tbaa !9
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.SHoughWorkspace, ptr %79, i32 0, i32 4
  %81 = load i32, ptr %80, align 4, !tbaa !20
  %82 = icmp ult i32 %78, %81
  br i1 %82, label %83, label %119

83:                                               ; preds = %77
  %84 = load double, ptr %26, align 8, !tbaa !17
  %85 = load ptr, ptr %21, align 8, !tbaa !5
  %86 = load i32, ptr %18, align 4, !tbaa !9
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds float, ptr %85, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !21
  %90 = fpext float %89 to double
  %91 = load double, ptr %27, align 8, !tbaa !17
  %92 = load ptr, ptr %20, align 8, !tbaa !5
  %93 = load i32, ptr %18, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds float, ptr %92, i64 %94
  %96 = load float, ptr %95, align 4, !tbaa !21
  %97 = fpext float %96 to double
  %98 = fmul double %91, %97
  %99 = call double @llvm.fmuladd.f64(double %84, double %90, double %98)
  %100 = load double, ptr %24, align 8, !tbaa !17
  %101 = fadd double %99, %100
  %102 = fadd double %101, 5.000000e-01
  %103 = fptoui double %102 to i32
  store i32 %103, ptr %17, align 4, !tbaa !9
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.SHoughWorkspace, ptr %106, i32 0, i32 4
  %108 = load i32, ptr %107, align 4, !tbaa !20
  %109 = mul i32 %105, %108
  %110 = load i32, ptr %18, align 4, !tbaa !9
  %111 = add i32 %109, %110
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds i32, ptr %104, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = add i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %83
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = add i32 %117, 1
  store i32 %118, ptr %18, align 4, !tbaa !9
  br label %77, !llvm.loop !23

119:                                              ; preds = %77
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br label %120

120:                                              ; preds = %119, %63
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i32 1
  store ptr %122, ptr %8, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %120
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %15, align 4, !tbaa !9
  br label %59, !llvm.loop !25

126:                                              ; preds = %59
  br label %127

127:                                              ; preds = %126
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %16, align 4, !tbaa !9
  br label %54, !llvm.loop !26

130:                                              ; preds = %54
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %131

131:                                              ; preds = %185, %130
  %132 = load i32, ptr %17, align 4, !tbaa !9
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.SHoughWorkspace, ptr %133, i32 0, i32 3
  %135 = load i32, ptr %134, align 8, !tbaa !18
  %136 = icmp ult i32 %132, %135
  br i1 %136, label %137, label %188

137:                                              ; preds = %131
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %181, %137
  %139 = load i32, ptr %18, align 4, !tbaa !9
  %140 = load ptr, ptr %14, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.SHoughWorkspace, ptr %140, i32 0, i32 4
  %142 = load i32, ptr %141, align 4, !tbaa !20
  %143 = icmp ult i32 %139, %142
  br i1 %143, label %144, label %184

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %145 = load i32, ptr %17, align 4, !tbaa !9
  %146 = load ptr, ptr %14, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.SHoughWorkspace, ptr %146, i32 0, i32 4
  %148 = load i32, ptr %147, align 4, !tbaa !20
  %149 = mul i32 %145, %148
  %150 = load i32, ptr %18, align 4, !tbaa !9
  %151 = add i32 %149, %150
  store i32 %151, ptr %28, align 4, !tbaa !9
  %152 = load ptr, ptr %19, align 8, !tbaa !5
  %153 = load i32, ptr %28, align 4, !tbaa !9
  %154 = zext i32 %153 to i64
  %155 = getelementptr inbounds i32, ptr %152, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !9
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = icmp ugt i32 %156, %157
  br i1 %158, label %159, label %180

159:                                              ; preds = %144
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = load i32, ptr %28, align 4, !tbaa !9
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.SHoughWorkspace, ptr %162, i32 0, i32 4
  %164 = load i32, ptr %163, align 4, !tbaa !20
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.SHoughWorkspace, ptr %165, i32 0, i32 3
  %167 = load i32, ptr %166, align 8, !tbaa !18
  %168 = call zeroext i8 @CheckMaximaLocal(ptr noundef %160, i32 noundef %161, i32 noundef %164, i32 noundef %167)
  %169 = zext i8 %168 to i32
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %171, label %180

171:                                              ; preds = %159
  %172 = load i32, ptr %28, align 4, !tbaa !9
  %173 = load ptr, ptr %19, align 8, !tbaa !5
  %174 = load i32, ptr %28, align 4, !tbaa !9
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds i32, ptr %173, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %178 = load ptr, ptr %14, align 8, !tbaa !5
  %179 = call zeroext i8 @insert_sort(i32 noundef %172, i32 noundef %177, ptr noundef %178)
  br label %180

180:                                              ; preds = %171, %159, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %18, align 4, !tbaa !9
  %183 = add i32 %182, 1
  store i32 %183, ptr %18, align 4, !tbaa !9
  br label %138, !llvm.loop !27

184:                                              ; preds = %138
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %17, align 4, !tbaa !9
  %187 = add i32 %186, 1
  store i32 %187, ptr %17, align 4, !tbaa !9
  br label %131, !llvm.loop !28

188:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %189 = load i32, ptr %13, align 4, !tbaa !9
  %190 = load ptr, ptr %14, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.SHoughWorkspace, ptr %190, i32 0, i32 9
  %192 = load i32, ptr %191, align 8, !tbaa !29
  %193 = icmp ule i32 %189, %192
  br i1 %193, label %194, label %196

194:                                              ; preds = %188
  %195 = load i32, ptr %13, align 4, !tbaa !9
  br label %200

196:                                              ; preds = %188
  %197 = load ptr, ptr %14, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.SHoughWorkspace, ptr %197, i32 0, i32 9
  %199 = load i32, ptr %198, align 8, !tbaa !29
  br label %200

200:                                              ; preds = %196, %194
  %201 = phi i32 [ %195, %194 ], [ %199, %196 ]
  store i32 %201, ptr %30, align 4, !tbaa !9
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %202

202:                                              ; preds = %257, %200
  %203 = load i32, ptr %29, align 4, !tbaa !9
  %204 = load i32, ptr %30, align 4, !tbaa !9
  %205 = icmp ult i32 %203, %204
  br i1 %205, label %206, label %260

206:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.SHoughWorkspace, ptr %207, i32 0, i32 8
  %209 = load ptr, ptr %208, align 8, !tbaa !30
  %210 = load i32, ptr %29, align 4, !tbaa !9
  %211 = zext i32 %210 to i64
  %212 = getelementptr inbounds %struct.SCollisionPoint, ptr %209, i64 %211
  %213 = getelementptr inbounds %struct.SCollisionPoint, ptr %212, i32 0, i32 0
  %214 = load i32, ptr %213, align 4, !tbaa !31
  store i32 %214, ptr %32, align 4, !tbaa !9
  %215 = load i32, ptr %32, align 4, !tbaa !9
  %216 = sitofp i32 %215 to float
  %217 = load ptr, ptr %14, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.SHoughWorkspace, ptr %217, i32 0, i32 4
  %219 = load i32, ptr %218, align 4, !tbaa !20
  %220 = uitofp i32 %219 to float
  %221 = fdiv float %216, %220
  %222 = fpext float %221 to double
  %223 = load double, ptr %25, align 8, !tbaa !17
  %224 = fdiv double %223, 2.000000e+00
  %225 = fsub double %222, %224
  %226 = fptrunc double %225 to float
  %227 = getelementptr inbounds %struct.SPolar, ptr %31, i32 0, i32 0
  store float %226, ptr %227, align 4, !tbaa !33
  %228 = load i32, ptr %32, align 4, !tbaa !9
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.SHoughWorkspace, ptr %229, i32 0, i32 4
  %231 = load i32, ptr %230, align 4, !tbaa !20
  %232 = urem i32 %228, %231
  %233 = uitofp i32 %232 to double
  %234 = fmul double %233, 0x3F91DF46A2529D39
  %235 = fptrunc double %234 to float
  %236 = getelementptr inbounds %struct.SPolar, ptr %31, i32 0, i32 1
  store float %235, ptr %236, align 4, !tbaa !35
  %237 = load ptr, ptr %12, align 8, !tbaa !5
  %238 = load i32, ptr %29, align 4, !tbaa !9
  %239 = zext i32 %238 to i64
  %240 = getelementptr inbounds %struct.SPolar, ptr %237, i64 %239
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %240, ptr align 4 %31, i64 8, i1 false), !tbaa.struct !36
  %241 = load i32, ptr %32, align 4, !tbaa !9
  %242 = getelementptr inbounds %struct.SPolar, ptr %31, i32 0, i32 0
  %243 = load float, ptr %242, align 4, !tbaa !33
  %244 = fpext float %243 to double
  %245 = getelementptr inbounds %struct.SPolar, ptr %31, i32 0, i32 1
  %246 = load float, ptr %245, align 4, !tbaa !35
  %247 = fpext float %246 to double
  %248 = load ptr, ptr %14, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.SHoughWorkspace, ptr %248, i32 0, i32 8
  %250 = load ptr, ptr %249, align 8, !tbaa !30
  %251 = load i32, ptr %29, align 4, !tbaa !9
  %252 = zext i32 %251 to i64
  %253 = getelementptr inbounds %struct.SCollisionPoint, ptr %250, i64 %252
  %254 = getelementptr inbounds %struct.SCollisionPoint, ptr %253, i32 0, i32 1
  %255 = load i32, ptr %254, align 4, !tbaa !37
  %256 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %241, double noundef %244, double noundef %247, i32 noundef %255)
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %257

257:                                              ; preds = %206
  %258 = load i32, ptr %29, align 4, !tbaa !9
  %259 = add i32 %258, 1
  store i32 %259, ptr %29, align 4, !tbaa !9
  br label %202, !llvm.loop !38

260:                                              ; preds = %202
  %261 = load i32, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  ret i32 %261
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @CheckMaximaLocal(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @insert_sort(i32 noundef, i32 noundef, ptr noundef) #0

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"SHoughWorkspace", !10, i64 0, !10, i64 4, !13, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !10, i64 36, !6, i64 40, !10, i64 48, !6, i64 56, !6, i64 64}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 56}
!15 = !{!12, !6, i64 64}
!16 = !{!12, !13, i64 8}
!17 = !{!13, !13, i64 0}
!18 = !{!12, !10, i64 16}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !10, i64 20}
!21 = !{!22, !22, i64 0}
!22 = !{!"float", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !24}
!28 = distinct !{!28, !24}
!29 = !{!12, !10, i64 48}
!30 = !{!12, !6, i64 40}
!31 = !{!32, !10, i64 0}
!32 = !{!"SCollisionPoint", !10, i64 0, !10, i64 4}
!33 = !{!34, !22, i64 0}
!34 = !{!"SPolar", !22, i64 0, !22, i64 4}
!35 = !{!34, !22, i64 4}
!36 = !{i64 0, i64 4, !21, i64 4, i64 4, !21}
!37 = !{!32, !10, i64 4}
!38 = distinct !{!38, !24}


; 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.SCollisionPoint = type { i32, i32 }
%struct.SPolar = type { float, float }

@.str = external hidden unnamed_addr constant [37 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @HoughLinesStandard(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef writeonly %4, i32 noundef %5, ptr noundef %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %6, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %6, i64 56
  %11 = load ptr, ptr %10, align 8, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %6, i64 64
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = lshr i32 %1, 1
  %15 = lshr i32 %2, 1
  %16 = getelementptr inbounds i8, ptr %6, i64 8
  %17 = load double, ptr %16, align 8, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %6, i64 16
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = uitofp i32 %19 to double
  tail call void @reset_workspace_hough(ptr noundef %6)
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %.preheader85, label %.preheader86.lr.ph

.preheader86.lr.ph:                               ; preds = %7
  %.not100 = icmp eq i32 %1, 0
  %21 = getelementptr inbounds i8, ptr %6, i64 20
  br i1 %.not100, label %.preheader85, label %.preheader86.us.preheader

.preheader86.us.preheader:                        ; preds = %.preheader86.lr.ph
  %22 = zext i32 %1 to i64
  br label %.preheader86.us

.preheader86.us:                                  ; preds = %.preheader86.us.preheader, %._crit_edge.us
  %.092.us = phi ptr [ %scevgep, %._crit_edge.us ], [ %0, %.preheader86.us.preheader ]
  %.07491.us = phi i32 [ %55, %._crit_edge.us ], [ 0, %.preheader86.us.preheader ]
  %23 = sub nsw i32 %.07491.us, %15
  %24 = sitofp i32 %23 to double
  br label %25

25:                                               ; preds = %.preheader86.us, %.loopexit.us
  %.189.us = phi ptr [ %.092.us, %.preheader86.us ], [ %53, %.loopexit.us ]
  %.07388.us = phi i32 [ 0, %.preheader86.us ], [ %54, %.loopexit.us ]
  %26 = load i8, ptr %.189.us, align 1, !tbaa !16
  %.not84.us = icmp eq i8 %26, 0
  br i1 %.not84.us, label %.loopexit.us, label %27

27:                                               ; preds = %25
  %28 = sub nsw i32 %.07388.us, %14
  %29 = sitofp i32 %28 to double
  %30 = load i32, ptr %21, align 4, !tbaa !17
  %.not101 = icmp eq i32 %30, 0
  br i1 %.not101, label %.loopexit.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %27, %.lr.ph.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.us ], [ 0, %27 ]
  %31 = phi i32 [ %50, %.lr.ph.us ], [ %30, %27 ]
  %32 = getelementptr inbounds float, ptr %13, i64 %indvars.iv
  %33 = load float, ptr %32, align 4, !tbaa !18
  %34 = fpext float %33 to double
  %35 = getelementptr inbounds float, ptr %11, i64 %indvars.iv
  %36 = load float, ptr %35, align 4, !tbaa !18
  %37 = fpext float %36 to double
  %38 = fmul double %24, %37
  %39 = tail call double @llvm.fmuladd.f64(double %29, double %34, double %38)
  %40 = fadd double %17, %39
  %41 = fadd double %40, 5.000000e-01
  %42 = fptoui double %41 to i32
  %43 = mul i32 %31, %42
  %44 = trunc nuw i64 %indvars.iv to i32
  %45 = add i32 %43, %44
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %9, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !20
  %49 = add i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %50 = load i32, ptr %21, align 4, !tbaa !17
  %51 = zext i32 %50 to i64
  %52 = icmp ult i64 %indvars.iv.next, %51
  br i1 %52, label %.lr.ph.us, label %.loopexit.us, !llvm.loop !21

.loopexit.us:                                     ; preds = %.lr.ph.us, %27, %25
  %53 = getelementptr inbounds i8, ptr %.189.us, i64 1
  %54 = add nuw nsw i32 %.07388.us, 1
  %exitcond.not = icmp eq i32 %54, %1
  br i1 %exitcond.not, label %._crit_edge.us, label %25, !llvm.loop !23

._crit_edge.us:                                   ; preds = %.loopexit.us
  %scevgep = getelementptr i8, ptr %.092.us, i64 %22
  %55 = add nuw nsw i32 %.07491.us, 1
  %exitcond109.not = icmp eq i32 %55, %2
  br i1 %exitcond109.not, label %.preheader85, label %.preheader86.us, !llvm.loop !24

.preheader85:                                     ; preds = %._crit_edge.us, %.preheader86.lr.ph, %7
  %56 = load i32, ptr %18, align 8, !tbaa !15
  %.not102 = icmp eq i32 %56, 0
  br i1 %.not102, label %._crit_edge95, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader85
  %57 = getelementptr inbounds i8, ptr %6, i64 20
  %58 = load i32, ptr %57, align 4, !tbaa !17
  %.not103 = icmp eq i32 %58, 0
  br i1 %.not103, label %._crit_edge95, label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %59 = phi i32 [ %79, %._crit_edge ], [ %56, %.preheader.lr.ph ]
  %60 = phi i32 [ %80, %._crit_edge ], [ %58, %.preheader.lr.ph ]
  %.07594 = phi i32 [ %81, %._crit_edge ], [ 0, %.preheader.lr.ph ]
  %.not104 = icmp eq i32 %60, 0
  br i1 %.not104, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %75
  %61 = phi i32 [ %77, %75 ], [ %60, %.preheader ]
  %.17893 = phi i32 [ %76, %75 ], [ 0, %.preheader ]
  %62 = mul i32 %61, %.07594
  %63 = add i32 %62, %.17893
  %64 = zext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %9, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = icmp ugt i32 %66, %3
  br i1 %67, label %68, label %75

68:                                               ; preds = %.lr.ph
  %69 = load i32, ptr %18, align 8, !tbaa !15
  %70 = tail call zeroext i8 @CheckMaximaLocal(ptr noundef nonnull %9, i32 noundef %63, i32 noundef %61, i32 noundef %69)
  %71 = icmp eq i8 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %68
  %73 = load i32, ptr %65, align 4, !tbaa !20
  %74 = tail call zeroext i8 @insert_sort(i32 noundef %63, i32 noundef %73, ptr noundef nonnull %6)
  br label %75

75:                                               ; preds = %72, %68, %.lr.ph
  %76 = add nuw i32 %.17893, 1
  %77 = load i32, ptr %57, align 4, !tbaa !17
  %78 = icmp ult i32 %76, %77
  br i1 %78, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !25

._crit_edge.loopexit:                             ; preds = %75
  %.pre = load i32, ptr %18, align 8, !tbaa !15
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %79 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %59, %.preheader ]
  %80 = phi i32 [ %77, %._crit_edge.loopexit ], [ 0, %.preheader ]
  %81 = add nuw i32 %.07594, 1
  %82 = icmp ult i32 %81, %79
  br i1 %82, label %.preheader, label %._crit_edge95, !llvm.loop !26

._crit_edge95:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %.preheader85
  %83 = getelementptr inbounds i8, ptr %6, i64 48
  %84 = load i32, ptr %83, align 8, !tbaa !28
  %. = tail call i32 @llvm.umin.i32(i32 %84, i32 %5)
  %.not105 = icmp eq i32 %., 0
  br i1 %.not105, label %._crit_edge99, label %.lr.ph98

.lr.ph98:                                         ; preds = %._crit_edge95
  %85 = getelementptr inbounds i8, ptr %6, i64 40
  %86 = getelementptr inbounds i8, ptr %6, i64 20
  %87 = fmul double %20, 5.000000e-01
  %wide.trip.count = zext i32 %. to i64
  br label %88

88:                                               ; preds = %.lr.ph98, %88
  %indvars.iv110 = phi i64 [ 0, %.lr.ph98 ], [ %indvars.iv.next111, %88 ]
  %89 = load ptr, ptr %85, align 8, !tbaa !29
  %90 = getelementptr inbounds %struct.SCollisionPoint, ptr %89, i64 %indvars.iv110
  %91 = load i32, ptr %90, align 4, !tbaa !30
  %92 = sitofp i32 %91 to float
  %93 = load i32, ptr %86, align 4, !tbaa !17
  %94 = uitofp i32 %93 to float
  %95 = fdiv float %92, %94
  %96 = fpext float %95 to double
  %97 = fsub double %96, %87
  %98 = fptrunc double %97 to float
  %99 = urem i32 %91, %93
  %100 = uitofp i32 %99 to double
  %101 = fmul double %100, 0x3F91DF46A2529D39
  %102 = fptrunc double %101 to float
  %103 = getelementptr inbounds %struct.SPolar, ptr %4, i64 %indvars.iv110
  store float %98, ptr %103, align 4, !tbaa !18
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 4
  store float %102, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !18
  %104 = fpext float %98 to double
  %105 = fpext float %102 to double
  %106 = getelementptr inbounds %struct.SCollisionPoint, ptr %89, i64 %indvars.iv110, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !32
  %108 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %91, double noundef %104, double noundef %105, i32 noundef %107)
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count
  br i1 %exitcond113.not, label %._crit_edge99, label %88, !llvm.loop !33

._crit_edge99:                                    ; preds = %88, %._crit_edge95
  ret i32 %.
}

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @CheckMaximaLocal(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @insert_sort(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !11, i64 24}
!6 = !{!"SHoughWorkspace", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !7, i64 32, !7, i64 36, !11, i64 40, !7, i64 48, !11, i64 56, !11, i64 64}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 56}
!13 = !{!6, !11, i64 64}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !7, i64 16}
!16 = !{!8, !8, i64 0}
!17 = !{!6, !7, i64 20}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !8, i64 0}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22, !27}
!27 = !{!"llvm.loop.unswitch.partial.disable"}
!28 = !{!6, !7, i64 48}
!29 = !{!6, !11, i64 40}
!30 = !{!31, !7, i64 0}
!31 = !{!"SCollisionPoint", !7, i64 0, !7, i64 4}
!32 = !{!31, !7, i64 4}
!33 = distinct !{!33, !22}


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