; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/vl (covdet)

; 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._VlFrameOrientedEllipse = type { float, float, float, float, float, float }
%struct._VlCovDet = type { ptr, ptr, i32, double, double, double, i64, i64, double, i64, ptr, i64, i64, ptr, i64, i32, [4 x %struct._VlCovDetFeatureOrientation], [4 x %struct._VlCovDetFeatureLaplacianScale], i32, [1681 x float], [1681 x float], [1681 x float], [1681 x float], [1089 x float], [10890 x float], [5 x i64] }
%struct._VlCovDetFeatureOrientation = type { double, double }
%struct._VlCovDetFeatureLaplacianScale = type { double, double }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame = external hidden unnamed_addr constant [116 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @vl_imsmooth_f(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, double noundef, double noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @vl_floor_d(double noundef) #6

; Function Attrs: nounwind uwtable
declare dso_local i32 @vl_covdet_extract_patch_helper(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, double noundef, double noundef, ptr noundef, ptr noundef, double noundef, double noundef) #7

declare void @vl_svd2(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

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

; Function Attrs: nounwind uwtable
define dso_local ptr @vl_covdet_extract_orientations_for_frame(ptr noundef %0, ptr noundef %1, ptr noundef byval(%struct._VlFrameOrientedEllipse) align 8 %2) #7 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca double, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca [36 x double], align 16
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca [4 x double], align 16
  %20 = alloca [2 x double], align 16
  %21 = alloca [4 x double], align 16
  %22 = alloca [4 x double], align 16
  %23 = alloca [4 x double], align 16
  %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 double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca i64, align 8
  %37 = alloca double, align 8
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca i64, align 8
  %42 = alloca double, align 8
  %43 = alloca double, align 8
  %44 = alloca double, align 8
  %45 = alloca double, align 8
  %46 = alloca double, align 8
  %47 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store double 9.000000e+00, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 20, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %48 = load i64, ptr %12, align 8, !tbaa !11
  %49 = mul i64 2, %48
  %50 = add i64 %49, 1
  store i64 %50, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store i64 36, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 288, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store double 0x3FC657184AE74487, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store double 8.000000e-01, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #8
  %51 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 2
  %52 = load float, ptr %51, align 8, !tbaa !13
  %53 = fpext float %52 to double
  store double %53, ptr %19, align 8, !tbaa !9
  %54 = getelementptr inbounds double, ptr %19, i64 1
  %55 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 4
  %56 = load float, ptr %55, align 8, !tbaa !16
  %57 = fpext float %56 to double
  store double %57, ptr %54, align 8, !tbaa !9
  %58 = getelementptr inbounds double, ptr %19, i64 2
  %59 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 3
  %60 = load float, ptr %59, align 4, !tbaa !17
  %61 = fpext float %60 to double
  store double %61, ptr %58, align 8, !tbaa !9
  %62 = getelementptr inbounds double, ptr %19, i64 3
  %63 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 5
  %64 = load float, ptr %63, align 4, !tbaa !18
  %65 = fpext float %64 to double
  store double %65, ptr %62, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  %66 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 0
  %67 = load float, ptr %66, align 8, !tbaa !19
  %68 = fpext float %67 to double
  store double %68, ptr %20, align 8, !tbaa !9
  %69 = getelementptr inbounds double, ptr %20, i64 1
  %70 = getelementptr inbounds %struct._VlFrameOrientedEllipse, ptr %2, i32 0, i32 1
  %71 = load float, ptr %70, align 4, !tbaa !20
  %72 = fpext float %71 to double
  store double %72, ptr %69, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  store double 1.000000e+00, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %76

75:                                               ; preds = %3
  br label %77

76:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 2717, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame) #9
  unreachable

77:                                               ; preds = %75
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %81

80:                                               ; preds = %77
  br label %82

81:                                               ; preds = %77
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.1, i32 noundef 2718, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame) #9
  unreachable

82:                                               ; preds = %80
  %83 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  %84 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 0
  %85 = getelementptr inbounds [4 x double], ptr %22, i64 0, i64 0
  %86 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 0
  call void @vl_svd2(ptr noundef %83, ptr noundef %84, ptr noundef %85, ptr noundef %86)
  %87 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 0
  %88 = load double, ptr %87, align 16, !tbaa !9
  %89 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  %90 = load double, ptr %89, align 16, !tbaa !9
  %91 = fmul double %88, %90
  %92 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 0
  store double %91, ptr %92, align 16, !tbaa !9
  %93 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 1
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  %96 = load double, ptr %95, align 16, !tbaa !9
  %97 = fmul double %94, %96
  %98 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 1
  store double %97, ptr %98, align 8, !tbaa !9
  %99 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 2
  %100 = load double, ptr %99, align 16, !tbaa !9
  %101 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 3
  %102 = load double, ptr %101, align 8, !tbaa !9
  %103 = fmul double %100, %102
  %104 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 2
  store double %103, ptr %104, align 16, !tbaa !9
  %105 = getelementptr inbounds [4 x double], ptr %21, i64 0, i64 3
  %106 = load double, ptr %105, align 8, !tbaa !9
  %107 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 3
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = fmul double %106, %108
  %110 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 3
  store double %109, ptr %110, align 8, !tbaa !9
  %111 = getelementptr inbounds [4 x double], ptr %22, i64 0, i64 1
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds [4 x double], ptr %22, i64 0, i64 0
  %114 = load double, ptr %113, align 16, !tbaa !9
  %115 = call double @atan2(double noundef %112, double noundef %114) #8
  store double %115, ptr %27, align 8, !tbaa !9
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._VlCovDet, ptr %117, i32 0, i32 19
  %119 = getelementptr inbounds [1681 x float], ptr %118, i64 0, i64 0
  %120 = load i64, ptr %12, align 8, !tbaa !11
  %121 = load double, ptr %11, align 8, !tbaa !9
  %122 = load double, ptr %26, align 8, !tbaa !9
  %123 = getelementptr inbounds [4 x double], ptr %19, i64 0, i64 0
  %124 = getelementptr inbounds [2 x double], ptr %20, i64 0, i64 0
  %125 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 0
  %126 = load double, ptr %125, align 16, !tbaa !9
  %127 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 3
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = call i32 @vl_covdet_extract_patch_helper(ptr noundef %116, ptr noundef %24, ptr noundef %25, ptr noundef %119, i64 noundef %120, double noundef %121, double noundef %122, ptr noundef %123, ptr noundef %124, double noundef %126, double noundef %128)
  store i32 %129, ptr %7, align 4, !tbaa !21
  %130 = load i32, ptr %7, align 4, !tbaa !21
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %82
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %133, align 8, !tbaa !11
  store ptr null, ptr %4, align 8
  store i32 1, ptr %28, align 4
  br label %438

134:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #8
  %135 = load double, ptr %26, align 8, !tbaa !9
  %136 = load double, ptr %26, align 8, !tbaa !9
  %137 = load double, ptr %24, align 8, !tbaa !9
  %138 = load double, ptr %24, align 8, !tbaa !9
  %139 = fmul double %137, %138
  %140 = fneg double %139
  %141 = call double @llvm.fmuladd.f64(double %135, double %136, double %140)
  %142 = fcmp ogt double %141, 0.000000e+00
  br i1 %142, label %143, label %151

143:                                              ; preds = %134
  %144 = load double, ptr %26, align 8, !tbaa !9
  %145 = load double, ptr %26, align 8, !tbaa !9
  %146 = load double, ptr %24, align 8, !tbaa !9
  %147 = load double, ptr %24, align 8, !tbaa !9
  %148 = fmul double %146, %147
  %149 = fneg double %148
  %150 = call double @llvm.fmuladd.f64(double %144, double %145, double %149)
  br label %152

151:                                              ; preds = %134
  br label %152

152:                                              ; preds = %151, %143
  %153 = phi double [ %150, %143 ], [ 0.000000e+00, %151 ]
  %154 = call double @sqrt(double noundef %153) #8
  store double %154, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %155 = load double, ptr %26, align 8, !tbaa !9
  %156 = load double, ptr %26, align 8, !tbaa !9
  %157 = load double, ptr %25, align 8, !tbaa !9
  %158 = load double, ptr %25, align 8, !tbaa !9
  %159 = fmul double %157, %158
  %160 = fneg double %159
  %161 = call double @llvm.fmuladd.f64(double %155, double %156, double %160)
  %162 = fcmp ogt double %161, 0.000000e+00
  br i1 %162, label %163, label %171

163:                                              ; preds = %152
  %164 = load double, ptr %26, align 8, !tbaa !9
  %165 = load double, ptr %26, align 8, !tbaa !9
  %166 = load double, ptr %25, align 8, !tbaa !9
  %167 = load double, ptr %25, align 8, !tbaa !9
  %168 = fmul double %166, %167
  %169 = fneg double %168
  %170 = call double @llvm.fmuladd.f64(double %164, double %165, double %169)
  br label %172

171:                                              ; preds = %152
  br label %172

172:                                              ; preds = %171, %163
  %173 = phi double [ %170, %163 ], [ 0.000000e+00, %171 ]
  %174 = call double @sqrt(double noundef %173) #8
  store double %174, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  %175 = load double, ptr %11, align 8, !tbaa !9
  %176 = load i64, ptr %12, align 8, !tbaa !11
  %177 = uitofp i64 %176 to double
  %178 = fdiv double %175, %177
  store double %178, ptr %31, align 8, !tbaa !9
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._VlCovDet, ptr %179, i32 0, i32 19
  %181 = getelementptr inbounds [1681 x float], ptr %180, i64 0, i64 0
  %182 = load i64, ptr %13, align 8, !tbaa !11
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct._VlCovDet, ptr %183, i32 0, i32 19
  %185 = getelementptr inbounds [1681 x float], ptr %184, i64 0, i64 0
  %186 = load i64, ptr %13, align 8, !tbaa !11
  %187 = load i64, ptr %13, align 8, !tbaa !11
  %188 = load i64, ptr %13, align 8, !tbaa !11
  %189 = load double, ptr %29, align 8, !tbaa !9
  %190 = load double, ptr %31, align 8, !tbaa !9
  %191 = fdiv double %189, %190
  %192 = load double, ptr %30, align 8, !tbaa !9
  %193 = load double, ptr %31, align 8, !tbaa !9
  %194 = fdiv double %192, %193
  call void @vl_imsmooth_f(ptr noundef %181, i64 noundef %182, ptr noundef %185, i64 noundef %186, i64 noundef %187, i64 noundef %188, double noundef %191, double noundef %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #8
  %195 = load ptr, ptr %5, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._VlCovDet, ptr %195, i32 0, i32 20
  %197 = getelementptr inbounds [1681 x float], ptr %196, i64 0, i64 0
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._VlCovDet, ptr %198, i32 0, i32 21
  %200 = getelementptr inbounds [1681 x float], ptr %199, i64 0, i64 0
  %201 = load i64, ptr %13, align 8, !tbaa !11
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct._VlCovDet, ptr %202, i32 0, i32 19
  %204 = getelementptr inbounds [1681 x float], ptr %203, i64 0, i64 0
  %205 = load i64, ptr %13, align 8, !tbaa !11
  %206 = load i64, ptr %13, align 8, !tbaa !11
  %207 = load i64, ptr %13, align 8, !tbaa !11
  call void @vl_imgradient_polar_f(ptr noundef %197, ptr noundef %200, i64 noundef 1, i64 noundef %201, ptr noundef %204, i64 noundef %205, i64 noundef %206, i64 noundef %207)
  %208 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %208, i8 0, i64 288, i1 false)
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %209

209:                                              ; preds = %267, %172
  %210 = load i64, ptr %8, align 8, !tbaa !11
  %211 = load i64, ptr %13, align 8, !tbaa !11
  %212 = load i64, ptr %13, align 8, !tbaa !11
  %213 = mul i64 %211, %212
  %214 = trunc i64 %213 to i32
  %215 = sext i32 %214 to i64
  %216 = icmp slt i64 %210, %215
  br i1 %216, label %217, label %270

217:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct._VlCovDet, ptr %218, i32 0, i32 20
  %220 = load i64, ptr %8, align 8, !tbaa !11
  %221 = getelementptr inbounds [1681 x float], ptr %219, i64 0, i64 %220
  %222 = load float, ptr %221, align 4, !tbaa !23
  %223 = fpext float %222 to double
  store double %223, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct._VlCovDet, ptr %224, i32 0, i32 21
  %226 = load i64, ptr %8, align 8, !tbaa !11
  %227 = getelementptr inbounds [1681 x float], ptr %225, i64 0, i64 %226
  %228 = load float, ptr %227, align 4, !tbaa !23
  %229 = fpext float %228 to double
  store double %229, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #8
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct._VlCovDet, ptr %230, i32 0, i32 22
  %232 = load i64, ptr %8, align 8, !tbaa !11
  %233 = getelementptr inbounds [1681 x float], ptr %231, i64 0, i64 %232
  %234 = load float, ptr %233, align 4, !tbaa !23
  %235 = fpext float %234 to double
  store double %235, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #8
  %236 = load double, ptr %33, align 8, !tbaa !9
  %237 = fdiv double %236, 0x3FC657184AE74487
  store double %237, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #8
  %238 = load double, ptr %35, align 8, !tbaa !9
  %239 = call i64 @vl_floor_d(double noundef %238)
  store i64 %239, ptr %36, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #8
  %240 = load double, ptr %35, align 8, !tbaa !9
  %241 = load i64, ptr %36, align 8, !tbaa !11
  %242 = sitofp i64 %241 to double
  %243 = fsub double %240, %242
  store double %243, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #8
  %244 = load double, ptr %37, align 8, !tbaa !9
  %245 = fsub double 1.000000e+00, %244
  store double %245, ptr %38, align 8, !tbaa !9
  %246 = load double, ptr %38, align 8, !tbaa !9
  %247 = load double, ptr %32, align 8, !tbaa !9
  %248 = load double, ptr %34, align 8, !tbaa !9
  %249 = fmul double %247, %248
  %250 = load i64, ptr %36, align 8, !tbaa !11
  %251 = add i64 %250, 36
  %252 = urem i64 %251, 36
  %253 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %252
  %254 = load double, ptr %253, align 8, !tbaa !9
  %255 = call double @llvm.fmuladd.f64(double %246, double %249, double %254)
  store double %255, ptr %253, align 8, !tbaa !9
  %256 = load double, ptr %37, align 8, !tbaa !9
  %257 = load double, ptr %32, align 8, !tbaa !9
  %258 = load double, ptr %34, align 8, !tbaa !9
  %259 = fmul double %257, %258
  %260 = load i64, ptr %36, align 8, !tbaa !11
  %261 = add i64 %260, 36
  %262 = add i64 %261, 1
  %263 = urem i64 %262, 36
  %264 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %263
  %265 = load double, ptr %264, align 8, !tbaa !9
  %266 = call double @llvm.fmuladd.f64(double %256, double %259, double %265)
  store double %266, ptr %264, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %267

267:                                              ; preds = %217
  %268 = load i64, ptr %8, align 8, !tbaa !11
  %269 = add nsw i64 %268, 1
  store i64 %269, ptr %8, align 8, !tbaa !11
  br label %209, !llvm.loop !24

270:                                              ; preds = %209
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %271

271:                                              ; preds = %315, %270
  %272 = load i64, ptr %10, align 8, !tbaa !11
  %273 = icmp slt i64 %272, 6
  br i1 %273, label %274, label %318

274:                                              ; preds = %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #8
  %275 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 35
  %276 = load double, ptr %275, align 8, !tbaa !9
  store double %276, ptr %39, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #8
  %277 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 0
  %278 = load double, ptr %277, align 16, !tbaa !9
  store double %278, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #8
  store i64 0, ptr %41, align 8, !tbaa !11
  br label %279

279:                                              ; preds = %301, %274
  %280 = load i64, ptr %41, align 8, !tbaa !11
  %281 = icmp slt i64 %280, 35
  br i1 %281, label %282, label %304

282:                                              ; preds = %279
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #8
  %283 = load double, ptr %39, align 8, !tbaa !9
  %284 = load i64, ptr %41, align 8, !tbaa !11
  %285 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %284
  %286 = load double, ptr %285, align 8, !tbaa !9
  %287 = fadd double %283, %286
  %288 = load i64, ptr %41, align 8, !tbaa !11
  %289 = add nsw i64 %288, 1
  %290 = urem i64 %289, 36
  %291 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %290
  %292 = load double, ptr %291, align 8, !tbaa !9
  %293 = fadd double %287, %292
  %294 = fdiv double %293, 3.000000e+00
  store double %294, ptr %42, align 8, !tbaa !9
  %295 = load i64, ptr %41, align 8, !tbaa !11
  %296 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %295
  %297 = load double, ptr %296, align 8, !tbaa !9
  store double %297, ptr %39, align 8, !tbaa !9
  %298 = load double, ptr %42, align 8, !tbaa !9
  %299 = load i64, ptr %41, align 8, !tbaa !11
  %300 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %299
  store double %298, ptr %300, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #8
  br label %301

301:                                              ; preds = %282
  %302 = load i64, ptr %41, align 8, !tbaa !11
  %303 = add nsw i64 %302, 1
  store i64 %303, ptr %41, align 8, !tbaa !11
  br label %279, !llvm.loop !26

304:                                              ; preds = %279
  %305 = load double, ptr %39, align 8, !tbaa !9
  %306 = load i64, ptr %41, align 8, !tbaa !11
  %307 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %306
  %308 = load double, ptr %307, align 8, !tbaa !9
  %309 = fadd double %305, %308
  %310 = load double, ptr %40, align 8, !tbaa !9
  %311 = fadd double %309, %310
  %312 = fdiv double %311, 3.000000e+00
  %313 = load i64, ptr %41, align 8, !tbaa !11
  %314 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %313
  store double %312, ptr %314, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #8
  br label %315

315:                                              ; preds = %304
  %316 = load i64, ptr %10, align 8, !tbaa !11
  %317 = add nsw i64 %316, 1
  store i64 %317, ptr %10, align 8, !tbaa !11
  br label %271, !llvm.loop !27

318:                                              ; preds = %271
  store double 0.000000e+00, ptr %18, align 8, !tbaa !9
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %319

319:                                              ; preds = %336, %318
  %320 = load i64, ptr %9, align 8, !tbaa !11
  %321 = icmp slt i64 %320, 36
  br i1 %321, label %322, label %339

322:                                              ; preds = %319
  %323 = load double, ptr %18, align 8, !tbaa !9
  %324 = load i64, ptr %9, align 8, !tbaa !11
  %325 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %324
  %326 = load double, ptr %325, align 8, !tbaa !9
  %327 = fcmp ogt double %323, %326
  br i1 %327, label %328, label %330

328:                                              ; preds = %322
  %329 = load double, ptr %18, align 8, !tbaa !9
  br label %334

330:                                              ; preds = %322
  %331 = load i64, ptr %9, align 8, !tbaa !11
  %332 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %331
  %333 = load double, ptr %332, align 8, !tbaa !9
  br label %334

334:                                              ; preds = %330, %328
  %335 = phi double [ %329, %328 ], [ %333, %330 ]
  store double %335, ptr %18, align 8, !tbaa !9
  br label %336

336:                                              ; preds = %334
  %337 = load i64, ptr %9, align 8, !tbaa !11
  %338 = add nsw i64 %337, 1
  store i64 %338, ptr %9, align 8, !tbaa !11
  br label %319, !llvm.loop !28

339:                                              ; preds = %319
  %340 = load ptr, ptr %6, align 8, !tbaa !5
  store i64 0, ptr %340, align 8, !tbaa !11
  store i64 0, ptr %9, align 8, !tbaa !11
  br label %341

341:                                              ; preds = %426, %339
  %342 = load i64, ptr %9, align 8, !tbaa !11
  %343 = icmp slt i64 %342, 36
  br i1 %343, label %344, label %429

344:                                              ; preds = %341
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #8
  %345 = load i64, ptr %9, align 8, !tbaa !11
  %346 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %345
  %347 = load double, ptr %346, align 8, !tbaa !9
  store double %347, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #8
  %348 = load i64, ptr %9, align 8, !tbaa !11
  %349 = sub nsw i64 %348, 1
  %350 = add i64 %349, 36
  %351 = urem i64 %350, 36
  %352 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %351
  %353 = load double, ptr %352, align 8, !tbaa !9
  store double %353, ptr %44, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #8
  %354 = load i64, ptr %9, align 8, !tbaa !11
  %355 = add nsw i64 %354, 1
  %356 = add i64 %355, 36
  %357 = urem i64 %356, 36
  %358 = getelementptr inbounds [36 x double], ptr %15, i64 0, i64 %357
  %359 = load double, ptr %358, align 8, !tbaa !9
  store double %359, ptr %45, align 8, !tbaa !9
  %360 = load double, ptr %43, align 8, !tbaa !9
  %361 = load double, ptr %18, align 8, !tbaa !9
  %362 = fmul double 8.000000e-01, %361
  %363 = fcmp ogt double %360, %362
  br i1 %363, label %364, label %422

364:                                              ; preds = %344
  %365 = load double, ptr %43, align 8, !tbaa !9
  %366 = load double, ptr %44, align 8, !tbaa !9
  %367 = fcmp ogt double %365, %366
  br i1 %367, label %368, label %422

368:                                              ; preds = %364
  %369 = load double, ptr %43, align 8, !tbaa !9
  %370 = load double, ptr %45, align 8, !tbaa !9
  %371 = fcmp ogt double %369, %370
  br i1 %371, label %372, label %422

372:                                              ; preds = %368
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #8
  %373 = load double, ptr %45, align 8, !tbaa !9
  %374 = load double, ptr %44, align 8, !tbaa !9
  %375 = fsub double %373, %374
  %376 = fmul double -5.000000e-01, %375
  %377 = load double, ptr %45, align 8, !tbaa !9
  %378 = load double, ptr %44, align 8, !tbaa !9
  %379 = fadd double %377, %378
  %380 = load double, ptr %43, align 8, !tbaa !9
  %381 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %380, double %379)
  %382 = fdiv double %376, %381
  store double %382, ptr %46, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #8
  %383 = load i64, ptr %9, align 8, !tbaa !11
  %384 = sitofp i64 %383 to double
  %385 = load double, ptr %46, align 8, !tbaa !9
  %386 = fadd double %384, %385
  %387 = load double, ptr %27, align 8, !tbaa !9
  %388 = call double @llvm.fmuladd.f64(double 0x3FC657184AE74487, double %386, double %387)
  store double %388, ptr %47, align 8, !tbaa !9
  %389 = load ptr, ptr %5, align 8, !tbaa !5
  %390 = getelementptr inbounds %struct._VlCovDet, ptr %389, i32 0, i32 15
  %391 = load i32, ptr %390, align 8, !tbaa !29
  %392 = icmp ne i32 %391, 0
  br i1 %392, label %393, label %396

393:                                              ; preds = %372
  %394 = load double, ptr %47, align 8, !tbaa !9
  %395 = fsub double %394, 0x3FF921FB54442D18
  store double %395, ptr %47, align 8, !tbaa !9
  br label %396

396:                                              ; preds = %393, %372
  %397 = load double, ptr %47, align 8, !tbaa !9
  %398 = load ptr, ptr %5, align 8, !tbaa !5
  %399 = getelementptr inbounds %struct._VlCovDet, ptr %398, i32 0, i32 16
  %400 = load ptr, ptr %6, align 8, !tbaa !5
  %401 = load i64, ptr %400, align 8, !tbaa !11
  %402 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %399, i64 0, i64 %401
  %403 = getelementptr inbounds %struct._VlCovDetFeatureOrientation, ptr %402, i32 0, i32 0
  store double %397, ptr %403, align 8, !tbaa !31
  %404 = load double, ptr %43, align 8, !tbaa !9
  %405 = load ptr, ptr %5, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct._VlCovDet, ptr %405, i32 0, i32 16
  %407 = load ptr, ptr %6, align 8, !tbaa !5
  %408 = load i64, ptr %407, align 8, !tbaa !11
  %409 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %406, i64 0, i64 %408
  %410 = getelementptr inbounds %struct._VlCovDetFeatureOrientation, ptr %409, i32 0, i32 1
  store double %404, ptr %410, align 8, !tbaa !33
  %411 = load ptr, ptr %6, align 8, !tbaa !5
  %412 = load i64, ptr %411, align 8, !tbaa !11
  %413 = add i64 %412, 1
  store i64 %413, ptr %411, align 8, !tbaa !11
  %414 = load ptr, ptr %6, align 8, !tbaa !5
  %415 = load i64, ptr %414, align 8, !tbaa !11
  %416 = icmp uge i64 %415, 4
  br i1 %416, label %417, label %418

417:                                              ; preds = %396
  store i32 14, ptr %28, align 4
  br label %419

418:                                              ; preds = %396
  store i32 0, ptr %28, align 4
  br label %419

419:                                              ; preds = %418, %417
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #8
  %420 = load i32, ptr %28, align 4
  switch i32 %420, label %423 [
    i32 0, label %421
  ]

421:                                              ; preds = %419
  br label %422

422:                                              ; preds = %421, %368, %364, %344
  store i32 0, ptr %28, align 4
  br label %423

423:                                              ; preds = %422, %419
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #8
  %424 = load i32, ptr %28, align 4
  switch i32 %424, label %440 [
    i32 0, label %425
    i32 14, label %429
  ]

425:                                              ; preds = %423
  br label %426

426:                                              ; preds = %425
  %427 = load i64, ptr %9, align 8, !tbaa !11
  %428 = add nsw i64 %427, 1
  store i64 %428, ptr %9, align 8, !tbaa !11
  br label %341, !llvm.loop !34

429:                                              ; preds = %423, %341
  %430 = load ptr, ptr %5, align 8, !tbaa !5
  %431 = getelementptr inbounds %struct._VlCovDet, ptr %430, i32 0, i32 16
  %432 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %431, i64 0, i64 0
  %433 = load ptr, ptr %6, align 8, !tbaa !5
  %434 = load i64, ptr %433, align 8, !tbaa !11
  call void @qsort(ptr noundef %432, i64 noundef %434, i64 noundef 16, ptr noundef @_vl_covdet_compare_orientations_descending)
  %435 = load ptr, ptr %5, align 8, !tbaa !5
  %436 = getelementptr inbounds %struct._VlCovDet, ptr %435, i32 0, i32 16
  %437 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %436, i64 0, i64 0
  store ptr %437, ptr %4, align 8
  store i32 1, ptr %28, align 4
  br label %438

438:                                              ; preds = %429, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 288, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  %439 = load ptr, ptr %4, align 8
  ret ptr %439

440:                                              ; preds = %423
  unreachable
}

declare void @vl_imgradient_polar_f(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) #5

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @_vl_covdet_compare_orientations_descending(ptr noundef, ptr noundef) #7

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 = { inlinehint 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !15, i64 8}
!14 = !{!"_VlFrameOrientedEllipse", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"float", !7, i64 0}
!16 = !{!14, !15, i64 16}
!17 = !{!14, !15, i64 12}
!18 = !{!14, !15, i64 20}
!19 = !{!14, !15, i64 0}
!20 = !{!14, !15, i64 4}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!15, !15, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !25}
!29 = !{!30, !22, i64 120}
!30 = !{!"_VlCovDet", !6, i64 0, !6, i64 8, !22, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !12, i64 48, !12, i64 56, !10, i64 64, !12, i64 72, !6, i64 80, !12, i64 88, !12, i64 96, !6, i64 104, !12, i64 112, !22, i64 120, !7, i64 128, !7, i64 192, !22, i64 256, !7, i64 260, !7, i64 6984, !7, i64 13708, !7, i64 20432, !7, i64 27156, !7, i64 31512, !7, i64 75072}
!31 = !{!32, !10, i64 0}
!32 = !{!"_VlCovDetFeatureOrientation", !10, i64 0, !10, i64 8}
!33 = !{!32, !10, i64 8}
!34 = distinct !{!34, !25}


; 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._VlFrameOrientedEllipse = type { float, float, float, float, float, float }
%struct._VlCovDetFeatureOrientation = type { double, double }

@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame = external hidden unnamed_addr constant [116 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare void @vl_imsmooth_f(ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef, double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @vl_floor_d(double noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @vl_covdet_extract_patch_helper(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, double noundef, double noundef, ptr noundef, ptr noundef, double noundef, double noundef) local_unnamed_addr #6

declare void @vl_svd2(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local ptr @vl_covdet_extract_orientations_for_frame(ptr noundef %0, ptr noundef writeonly %1, ptr nocapture noundef readonly byval(%struct._VlFrameOrientedEllipse) align 8 %2) local_unnamed_addr #6 {
  %4 = alloca [36 x double], align 16
  %5 = alloca [4 x double], align 16
  %6 = alloca [2 x double], align 16
  %7 = alloca [4 x double], align 16
  %8 = alloca [4 x double], align 16
  %9 = alloca [4 x double], align 16
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #10
  %12 = getelementptr inbounds i8, ptr %2, i64 8
  %13 = load <4 x float>, ptr %12, align 8
  %14 = shufflevector <4 x float> %13, <4 x float> poison, <2 x i32> <i32 0, i32 poison>
  %15 = getelementptr inbounds i8, ptr %2, i64 16
  %16 = load float, ptr %15, align 8, !tbaa !5
  %17 = insertelement <2 x float> %14, float %16, i64 1
  %18 = fpext <2 x float> %17 to <2 x double>
  store <2 x double> %18, ptr %5, align 16, !tbaa !10
  %19 = getelementptr inbounds i8, ptr %5, i64 16
  %20 = load <4 x float>, ptr %2, align 8
  %21 = shufflevector <4 x float> %20, <4 x float> poison, <2 x i32> <i32 3, i32 poison>
  %22 = getelementptr inbounds i8, ptr %2, i64 20
  %23 = load float, ptr %22, align 4, !tbaa !12
  %24 = insertelement <2 x float> %21, float %23, i64 1
  %25 = fpext <2 x float> %24 to <2 x double>
  store <2 x double> %25, ptr %19, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #10
  %26 = load <2 x float>, ptr %2, align 8, !tbaa !13
  %27 = fpext <2 x float> %26 to <2 x double>
  store <2 x double> %27, ptr %6, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #10
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %28, label %29

28:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 2717, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame) #11
  unreachable

29:                                               ; preds = %3
  %.not132 = icmp eq ptr %1, null
  br i1 %.not132, label %30, label %31

30:                                               ; preds = %29
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.1, i32 noundef 2718, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_extract_orientations_for_frame) #11
  unreachable

31:                                               ; preds = %29
  call void @vl_svd2(ptr noundef nonnull %9, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %5) #10
  %32 = load <2 x double>, ptr %9, align 16
  %33 = load <2 x double>, ptr %7, align 16, !tbaa !10
  %34 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
  %35 = fmul <2 x double> %34, %33
  store <2 x double> %35, ptr %5, align 16, !tbaa !10
  %36 = getelementptr inbounds i8, ptr %7, i64 16
  %37 = getelementptr inbounds i8, ptr %9, i64 24
  %38 = load double, ptr %37, align 8, !tbaa !10
  %39 = load <2 x double>, ptr %36, align 16, !tbaa !10
  %40 = insertelement <2 x double> poison, double %38, i64 0
  %41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> zeroinitializer
  %42 = fmul <2 x double> %41, %39
  store <2 x double> %42, ptr %19, align 16, !tbaa !10
  %43 = getelementptr inbounds i8, ptr %8, i64 8
  %44 = load double, ptr %43, align 8, !tbaa !10
  %45 = load double, ptr %8, align 16, !tbaa !10
  %46 = call double @atan2(double noundef %44, double noundef %45) #10
  %47 = getelementptr inbounds i8, ptr %0, i64 260
  %48 = load double, ptr %9, align 16, !tbaa !10
  %49 = load double, ptr %37, align 8, !tbaa !10
  %50 = call i32 @vl_covdet_extract_patch_helper(ptr noundef nonnull %0, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %47, i64 noundef 20, double noundef 9.000000e+00, double noundef 1.000000e+00, ptr noundef nonnull %5, ptr noundef nonnull %6, double noundef %48, double noundef %49)
  %.not133 = icmp eq i32 %50, 0
  br i1 %.not133, label %52, label %51

51:                                               ; preds = %31
  store i64 0, ptr %1, align 8, !tbaa !14
  br label %436

52:                                               ; preds = %31
  %53 = load double, ptr %10, align 8, !tbaa !10
  %54 = fmul double %53, %53
  %55 = fsub double 1.000000e+00, %54
  %56 = fcmp ogt double %55, 0.000000e+00
  %57 = select i1 %56, double %55, double 0.000000e+00
  %sqrt136 = call double @llvm.sqrt.f64(double %57)
  %58 = load double, ptr %11, align 8, !tbaa !10
  %59 = fmul double %58, %58
  %60 = fsub double 1.000000e+00, %59
  %61 = fcmp ogt double %60, 0.000000e+00
  %62 = select i1 %61, double %60, double 0.000000e+00
  %sqrt = call double @llvm.sqrt.f64(double %62)
  %63 = fdiv double %sqrt136, 4.500000e-01
  %64 = fdiv double %sqrt, 4.500000e-01
  call void @vl_imsmooth_f(ptr noundef nonnull %47, i64 noundef 41, ptr noundef nonnull %47, i64 noundef 41, i64 noundef 41, i64 noundef 41, double noundef %63, double noundef %64) #10
  %65 = getelementptr inbounds i8, ptr %0, i64 6984
  %66 = getelementptr inbounds i8, ptr %0, i64 13708
  call void @vl_imgradient_polar_f(ptr noundef nonnull %65, ptr noundef nonnull %66, i64 noundef 1, i64 noundef 41, ptr noundef nonnull %47, i64 noundef 41, i64 noundef 41, i64 noundef 41) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(288) %4, i8 0, i64 288, i1 false)
  %67 = getelementptr inbounds i8, ptr %0, i64 20432
  br label %123

.preheader137:                                    ; preds = %123
  %68 = getelementptr inbounds i8, ptr %4, i64 280
  %.pre = load double, ptr %68, align 8, !tbaa !10
  %69 = getelementptr inbounds i8, ptr %4, i64 8
  %70 = getelementptr inbounds i8, ptr %4, i64 16
  %71 = getelementptr inbounds i8, ptr %4, i64 24
  %72 = getelementptr inbounds i8, ptr %4, i64 32
  %73 = getelementptr inbounds i8, ptr %4, i64 40
  %74 = getelementptr inbounds i8, ptr %4, i64 48
  %75 = getelementptr inbounds i8, ptr %4, i64 56
  %76 = getelementptr inbounds i8, ptr %4, i64 64
  %77 = getelementptr inbounds i8, ptr %4, i64 72
  %78 = getelementptr inbounds i8, ptr %4, i64 80
  %79 = getelementptr inbounds i8, ptr %4, i64 88
  %80 = getelementptr inbounds i8, ptr %4, i64 96
  %81 = getelementptr inbounds i8, ptr %4, i64 104
  %82 = getelementptr inbounds i8, ptr %4, i64 112
  %83 = getelementptr inbounds i8, ptr %4, i64 120
  %84 = getelementptr inbounds i8, ptr %4, i64 128
  %85 = getelementptr inbounds i8, ptr %4, i64 136
  %86 = getelementptr inbounds i8, ptr %4, i64 144
  %87 = getelementptr inbounds i8, ptr %4, i64 152
  %88 = getelementptr inbounds i8, ptr %4, i64 160
  %89 = getelementptr inbounds i8, ptr %4, i64 168
  %90 = getelementptr inbounds i8, ptr %4, i64 176
  %91 = getelementptr inbounds i8, ptr %4, i64 184
  %92 = getelementptr inbounds i8, ptr %4, i64 192
  %93 = getelementptr inbounds i8, ptr %4, i64 200
  %94 = getelementptr inbounds i8, ptr %4, i64 208
  %95 = getelementptr inbounds i8, ptr %4, i64 216
  %96 = getelementptr inbounds i8, ptr %4, i64 224
  %97 = getelementptr inbounds i8, ptr %4, i64 232
  %98 = getelementptr inbounds i8, ptr %4, i64 240
  %99 = getelementptr inbounds i8, ptr %4, i64 248
  %100 = getelementptr inbounds i8, ptr %4, i64 256
  %101 = getelementptr inbounds i8, ptr %4, i64 264
  %102 = getelementptr inbounds i8, ptr %4, i64 272
  %.promoted = load double, ptr %4, align 16, !tbaa !10
  %.promoted187 = load double, ptr %69, align 8, !tbaa !10
  %.promoted189 = load double, ptr %70, align 16, !tbaa !10
  %103 = load <2 x double>, ptr %71, align 8, !tbaa !10
  %104 = load <2 x double>, ptr %73, align 8, !tbaa !10
  %105 = load <2 x double>, ptr %75, align 8, !tbaa !10
  %106 = load <2 x double>, ptr %77, align 8, !tbaa !10
  %107 = load <2 x double>, ptr %79, align 8, !tbaa !10
  %108 = load <2 x double>, ptr %81, align 8, !tbaa !10
  %109 = load <2 x double>, ptr %83, align 8, !tbaa !10
  %110 = load <2 x double>, ptr %85, align 8, !tbaa !10
  %111 = load <2 x double>, ptr %87, align 8, !tbaa !10
  %112 = load <2 x double>, ptr %89, align 8, !tbaa !10
  %113 = load <2 x double>, ptr %91, align 8, !tbaa !10
  %114 = load <2 x double>, ptr %93, align 8, !tbaa !10
  %115 = load <2 x double>, ptr %95, align 8, !tbaa !10
  %116 = load <2 x double>, ptr %97, align 8, !tbaa !10
  %117 = load <2 x double>, ptr %99, align 8, !tbaa !10
  %118 = load <2 x double>, ptr %101, align 8, !tbaa !10
  %.promoted255 = load double, ptr %68, align 8, !tbaa !10
  %119 = insertelement <2 x double> poison, double %.pre, i64 0
  %120 = insertelement <2 x double> %119, double %.promoted187, i64 1
  %121 = insertelement <2 x double> poison, double %.promoted255, i64 0
  %122 = insertelement <2 x double> %121, double %.promoted, i64 1
  br label %150

123:                                              ; preds = %52, %123
  %.0116138 = phi i64 [ 0, %52 ], [ %149, %123 ]
  %124 = getelementptr inbounds [1681 x float], ptr %65, i64 0, i64 %.0116138
  %125 = load float, ptr %124, align 4, !tbaa !13
  %126 = fpext float %125 to double
  %127 = getelementptr inbounds [1681 x float], ptr %66, i64 0, i64 %.0116138
  %128 = load float, ptr %127, align 4, !tbaa !13
  %129 = fpext float %128 to double
  %130 = getelementptr inbounds [1681 x float], ptr %67, i64 0, i64 %.0116138
  %131 = load float, ptr %130, align 4, !tbaa !13
  %132 = fpext float %131 to double
  %133 = fdiv double %129, 0x3FC657184AE74487
  %134 = call i64 @vl_floor_d(double noundef %133)
  %135 = sitofp i64 %134 to double
  %136 = fsub double %133, %135
  %137 = fsub double 1.000000e+00, %136
  %138 = fmul double %126, %132
  %139 = add i64 %134, 36
  %140 = urem i64 %139, 36
  %141 = getelementptr inbounds [36 x double], ptr %4, i64 0, i64 %140
  %142 = load double, ptr %141, align 8, !tbaa !10
  %143 = call double @llvm.fmuladd.f64(double %137, double %138, double %142)
  store double %143, ptr %141, align 8, !tbaa !10
  %144 = add i64 %134, 37
  %145 = urem i64 %144, 36
  %146 = getelementptr inbounds [36 x double], ptr %4, i64 0, i64 %145
  %147 = load double, ptr %146, align 8, !tbaa !10
  %148 = call double @llvm.fmuladd.f64(double %136, double %138, double %147)
  store double %148, ptr %146, align 8, !tbaa !10
  %149 = add nuw nsw i64 %.0116138, 1
  %exitcond.not = icmp eq i64 %149, 1681
  br i1 %exitcond.not, label %.preheader137, label %123, !llvm.loop !16

150:                                              ; preds = %.preheader137, %150
  %151 = phi double [ %.promoted189, %.preheader137 ], [ %266, %150 ]
  %.0118141 = phi i64 [ 0, %.preheader137 ], [ %262, %150 ]
  %152 = phi <2 x double> [ %120, %.preheader137 ], [ %263, %150 ]
  %153 = phi <2 x double> [ %103, %.preheader137 ], [ %265, %150 ]
  %154 = phi <2 x double> [ %104, %.preheader137 ], [ %268, %150 ]
  %155 = phi <2 x double> [ %105, %.preheader137 ], [ %270, %150 ]
  %156 = phi <2 x double> [ %106, %.preheader137 ], [ %272, %150 ]
  %157 = phi <2 x double> [ %107, %.preheader137 ], [ %274, %150 ]
  %158 = phi <2 x double> [ %108, %.preheader137 ], [ %276, %150 ]
  %159 = phi <2 x double> [ %109, %.preheader137 ], [ %278, %150 ]
  %160 = phi <2 x double> [ %110, %.preheader137 ], [ %280, %150 ]
  %161 = phi <2 x double> [ %111, %.preheader137 ], [ %282, %150 ]
  %162 = phi <2 x double> [ %112, %.preheader137 ], [ %284, %150 ]
  %163 = phi <2 x double> [ %113, %.preheader137 ], [ %286, %150 ]
  %164 = phi <2 x double> [ %114, %.preheader137 ], [ %288, %150 ]
  %165 = phi <2 x double> [ %115, %.preheader137 ], [ %290, %150 ]
  %166 = phi <2 x double> [ %116, %.preheader137 ], [ %292, %150 ]
  %167 = phi <2 x double> [ %117, %.preheader137 ], [ %294, %150 ]
  %168 = phi <2 x double> [ %118, %.preheader137 ], [ %296, %150 ]
  %169 = phi <2 x double> [ %122, %.preheader137 ], [ %298, %150 ]
  %170 = shufflevector <2 x double> %169, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %171 = fadd <2 x double> %170, %152
  %172 = shufflevector <2 x double> %152, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %173 = insertelement <2 x double> %172, double %151, i64 1
  %174 = fadd <2 x double> %171, %173
  %175 = fdiv <2 x double> %174, <double 3.000000e+00, double 3.000000e+00>
  %176 = shufflevector <2 x double> %172, <2 x double> %153, <2 x i32> <i32 0, i32 2>
  %177 = insertelement <2 x double> poison, double %151, i64 0
  %178 = shufflevector <2 x double> %177, <2 x double> poison, <2 x i32> zeroinitializer
  %179 = fadd <2 x double> %176, %178
  %180 = fadd <2 x double> %179, %153
  %181 = fdiv <2 x double> %180, <double 3.000000e+00, double 3.000000e+00>
  %182 = shufflevector <2 x double> %153, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %183 = shufflevector <2 x double> %153, <2 x double> %154, <2 x i32> <i32 0, i32 2>
  %184 = fadd <2 x double> %182, %183
  %185 = fadd <2 x double> %184, %154
  %186 = fdiv <2 x double> %185, <double 3.000000e+00, double 3.000000e+00>
  %187 = shufflevector <2 x double> %154, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %188 = shufflevector <2 x double> %154, <2 x double> %155, <2 x i32> <i32 0, i32 2>
  %189 = fadd <2 x double> %187, %188
  %190 = fadd <2 x double> %189, %155
  %191 = fdiv <2 x double> %190, <double 3.000000e+00, double 3.000000e+00>
  %192 = shufflevector <2 x double> %155, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %193 = shufflevector <2 x double> %155, <2 x double> %156, <2 x i32> <i32 0, i32 2>
  %194 = fadd <2 x double> %192, %193
  %195 = fadd <2 x double> %194, %156
  %196 = fdiv <2 x double> %195, <double 3.000000e+00, double 3.000000e+00>
  %197 = shufflevector <2 x double> %156, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %198 = shufflevector <2 x double> %156, <2 x double> %157, <2 x i32> <i32 0, i32 2>
  %199 = fadd <2 x double> %197, %198
  %200 = fadd <2 x double> %199, %157
  %201 = fdiv <2 x double> %200, <double 3.000000e+00, double 3.000000e+00>
  %202 = shufflevector <2 x double> %157, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %203 = shufflevector <2 x double> %157, <2 x double> %158, <2 x i32> <i32 0, i32 2>
  %204 = fadd <2 x double> %202, %203
  %205 = fadd <2 x double> %204, %158
  %206 = fdiv <2 x double> %205, <double 3.000000e+00, double 3.000000e+00>
  %207 = shufflevector <2 x double> %158, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %208 = shufflevector <2 x double> %158, <2 x double> %159, <2 x i32> <i32 0, i32 2>
  %209 = fadd <2 x double> %207, %208
  %210 = fadd <2 x double> %209, %159
  %211 = fdiv <2 x double> %210, <double 3.000000e+00, double 3.000000e+00>
  %212 = shufflevector <2 x double> %159, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %213 = shufflevector <2 x double> %159, <2 x double> %160, <2 x i32> <i32 0, i32 2>
  %214 = fadd <2 x double> %212, %213
  %215 = fadd <2 x double> %214, %160
  %216 = fdiv <2 x double> %215, <double 3.000000e+00, double 3.000000e+00>
  %217 = shufflevector <2 x double> %160, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %218 = shufflevector <2 x double> %160, <2 x double> %161, <2 x i32> <i32 0, i32 2>
  %219 = fadd <2 x double> %217, %218
  %220 = fadd <2 x double> %219, %161
  %221 = fdiv <2 x double> %220, <double 3.000000e+00, double 3.000000e+00>
  %222 = shufflevector <2 x double> %161, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %223 = shufflevector <2 x double> %161, <2 x double> %162, <2 x i32> <i32 0, i32 2>
  %224 = fadd <2 x double> %222, %223
  %225 = fadd <2 x double> %224, %162
  %226 = fdiv <2 x double> %225, <double 3.000000e+00, double 3.000000e+00>
  %227 = shufflevector <2 x double> %162, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %228 = shufflevector <2 x double> %162, <2 x double> %163, <2 x i32> <i32 0, i32 2>
  %229 = fadd <2 x double> %227, %228
  %230 = fadd <2 x double> %229, %163
  %231 = fdiv <2 x double> %230, <double 3.000000e+00, double 3.000000e+00>
  %232 = shufflevector <2 x double> %163, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %233 = shufflevector <2 x double> %163, <2 x double> %164, <2 x i32> <i32 0, i32 2>
  %234 = fadd <2 x double> %232, %233
  %235 = fadd <2 x double> %234, %164
  %236 = fdiv <2 x double> %235, <double 3.000000e+00, double 3.000000e+00>
  %237 = shufflevector <2 x double> %164, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %238 = shufflevector <2 x double> %164, <2 x double> %165, <2 x i32> <i32 0, i32 2>
  %239 = fadd <2 x double> %237, %238
  %240 = fadd <2 x double> %239, %165
  %241 = fdiv <2 x double> %240, <double 3.000000e+00, double 3.000000e+00>
  %242 = shufflevector <2 x double> %165, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %243 = shufflevector <2 x double> %165, <2 x double> %166, <2 x i32> <i32 0, i32 2>
  %244 = fadd <2 x double> %242, %243
  %245 = fadd <2 x double> %244, %166
  %246 = fdiv <2 x double> %245, <double 3.000000e+00, double 3.000000e+00>
  %247 = shufflevector <2 x double> %166, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %248 = shufflevector <2 x double> %166, <2 x double> %167, <2 x i32> <i32 0, i32 2>
  %249 = fadd <2 x double> %247, %248
  %250 = fadd <2 x double> %249, %167
  %251 = fdiv <2 x double> %250, <double 3.000000e+00, double 3.000000e+00>
  %252 = shufflevector <2 x double> %167, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %253 = shufflevector <2 x double> %167, <2 x double> %168, <2 x i32> <i32 0, i32 2>
  %254 = fadd <2 x double> %252, %253
  %255 = fadd <2 x double> %254, %168
  %256 = fdiv <2 x double> %255, <double 3.000000e+00, double 3.000000e+00>
  %257 = shufflevector <2 x double> %168, <2 x double> poison, <2 x i32> <i32 1, i32 1>
  %258 = shufflevector <2 x double> %168, <2 x double> %169, <2 x i32> <i32 0, i32 2>
  %259 = fadd <2 x double> %257, %258
  %260 = fadd <2 x double> %259, %169
  %261 = fdiv <2 x double> %260, <double 3.000000e+00, double 3.000000e+00>
  %262 = add nuw nsw i64 %.0118141, 1
  %exitcond148.not = icmp eq i64 %262, 6
  %263 = shufflevector <2 x double> %175, <2 x double> %261, <2 x i32> <i32 3, i32 1>
  %264 = shufflevector <2 x double> %181, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %265 = shufflevector <2 x double> %264, <2 x double> %186, <2 x i32> <i32 0, i32 2>
  %266 = extractelement <2 x double> %181, i64 0
  %267 = shufflevector <2 x double> %186, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %268 = shufflevector <2 x double> %267, <2 x double> %191, <2 x i32> <i32 0, i32 2>
  %269 = shufflevector <2 x double> %191, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %270 = shufflevector <2 x double> %269, <2 x double> %196, <2 x i32> <i32 0, i32 2>
  %271 = shufflevector <2 x double> %196, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %272 = shufflevector <2 x double> %271, <2 x double> %201, <2 x i32> <i32 0, i32 2>
  %273 = shufflevector <2 x double> %201, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %274 = shufflevector <2 x double> %273, <2 x double> %206, <2 x i32> <i32 0, i32 2>
  %275 = shufflevector <2 x double> %206, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %276 = shufflevector <2 x double> %275, <2 x double> %211, <2 x i32> <i32 0, i32 2>
  %277 = shufflevector <2 x double> %211, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %278 = shufflevector <2 x double> %277, <2 x double> %216, <2 x i32> <i32 0, i32 2>
  %279 = shufflevector <2 x double> %216, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %280 = shufflevector <2 x double> %279, <2 x double> %221, <2 x i32> <i32 0, i32 2>
  %281 = shufflevector <2 x double> %221, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %282 = shufflevector <2 x double> %281, <2 x double> %226, <2 x i32> <i32 0, i32 2>
  %283 = shufflevector <2 x double> %226, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %284 = shufflevector <2 x double> %283, <2 x double> %231, <2 x i32> <i32 0, i32 2>
  %285 = shufflevector <2 x double> %231, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %286 = shufflevector <2 x double> %285, <2 x double> %236, <2 x i32> <i32 0, i32 2>
  %287 = shufflevector <2 x double> %236, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %288 = shufflevector <2 x double> %287, <2 x double> %241, <2 x i32> <i32 0, i32 2>
  %289 = shufflevector <2 x double> %241, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %290 = shufflevector <2 x double> %289, <2 x double> %246, <2 x i32> <i32 0, i32 2>
  %291 = shufflevector <2 x double> %246, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %292 = shufflevector <2 x double> %291, <2 x double> %251, <2 x i32> <i32 0, i32 2>
  %293 = shufflevector <2 x double> %251, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %294 = shufflevector <2 x double> %293, <2 x double> %256, <2 x i32> <i32 0, i32 2>
  %295 = shufflevector <2 x double> %256, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %296 = shufflevector <2 x double> %295, <2 x double> %261, <2 x i32> <i32 0, i32 2>
  %297 = shufflevector <2 x double> %175, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
  %298 = shufflevector <2 x double> %297, <2 x double> %261, <2 x i32> <i32 3, i32 1>
  br i1 %exitcond148.not, label %.preheader.preheader, label %150, !llvm.loop !18

.preheader.preheader:                             ; preds = %150
  store <2 x double> %175, ptr %4, align 16, !tbaa !10
  store <2 x double> %181, ptr %70, align 16, !tbaa !10
  store <2 x double> %186, ptr %72, align 16, !tbaa !10
  store <2 x double> %191, ptr %74, align 16, !tbaa !10
  store <2 x double> %196, ptr %76, align 16, !tbaa !10
  store <2 x double> %201, ptr %78, align 16, !tbaa !10
  store <2 x double> %206, ptr %80, align 16, !tbaa !10
  store <2 x double> %211, ptr %82, align 16, !tbaa !10
  store <2 x double> %216, ptr %84, align 16, !tbaa !10
  store <2 x double> %221, ptr %86, align 16, !tbaa !10
  store <2 x double> %226, ptr %88, align 16, !tbaa !10
  store <2 x double> %231, ptr %90, align 16, !tbaa !10
  store <2 x double> %236, ptr %92, align 16, !tbaa !10
  store <2 x double> %241, ptr %94, align 16, !tbaa !10
  store <2 x double> %246, ptr %96, align 16, !tbaa !10
  store <2 x double> %251, ptr %98, align 16, !tbaa !10
  store <2 x double> %256, ptr %100, align 16, !tbaa !10
  store <2 x double> %261, ptr %102, align 16, !tbaa !10
  %299 = getelementptr inbounds i8, ptr %4, i64 8
  %300 = getelementptr inbounds i8, ptr %4, i64 16
  %301 = getelementptr inbounds i8, ptr %4, i64 24
  %302 = getelementptr inbounds i8, ptr %4, i64 32
  %303 = getelementptr inbounds i8, ptr %4, i64 40
  %304 = getelementptr inbounds i8, ptr %4, i64 48
  %305 = getelementptr inbounds i8, ptr %4, i64 56
  %306 = getelementptr inbounds i8, ptr %4, i64 64
  %307 = getelementptr inbounds i8, ptr %4, i64 72
  %308 = getelementptr inbounds i8, ptr %4, i64 80
  %309 = getelementptr inbounds i8, ptr %4, i64 88
  %310 = getelementptr inbounds i8, ptr %4, i64 96
  %311 = getelementptr inbounds i8, ptr %4, i64 104
  %312 = getelementptr inbounds i8, ptr %4, i64 112
  %313 = getelementptr inbounds i8, ptr %4, i64 120
  %314 = getelementptr inbounds i8, ptr %4, i64 128
  %315 = getelementptr inbounds i8, ptr %4, i64 136
  %316 = getelementptr inbounds i8, ptr %4, i64 144
  %317 = load double, ptr %4, align 16, !tbaa !10
  %318 = fcmp olt double %317, 0.000000e+00
  %.0119. = select i1 %318, double 0.000000e+00, double %317
  %319 = load double, ptr %299, align 8, !tbaa !10
  %320 = fcmp ogt double %.0119., %319
  %.0119..1 = select i1 %320, double %.0119., double %319
  %321 = load double, ptr %300, align 16, !tbaa !10
  %322 = fcmp ogt double %.0119..1, %321
  %.0119..2 = select i1 %322, double %.0119..1, double %321
  %323 = load double, ptr %301, align 8, !tbaa !10
  %324 = fcmp ogt double %.0119..2, %323
  %.0119..3 = select i1 %324, double %.0119..2, double %323
  %325 = load double, ptr %302, align 16, !tbaa !10
  %326 = fcmp ogt double %.0119..3, %325
  %.0119..4 = select i1 %326, double %.0119..3, double %325
  %327 = load double, ptr %303, align 8, !tbaa !10
  %328 = fcmp ogt double %.0119..4, %327
  %.0119..5 = select i1 %328, double %.0119..4, double %327
  %329 = load double, ptr %304, align 16, !tbaa !10
  %330 = fcmp ogt double %.0119..5, %329
  %.0119..6 = select i1 %330, double %.0119..5, double %329
  %331 = load double, ptr %305, align 8, !tbaa !10
  %332 = fcmp ogt double %.0119..6, %331
  %.0119..7 = select i1 %332, double %.0119..6, double %331
  %333 = load double, ptr %306, align 16, !tbaa !10
  %334 = fcmp ogt double %.0119..7, %333
  %.0119..8 = select i1 %334, double %.0119..7, double %333
  %335 = load double, ptr %307, align 8, !tbaa !10
  %336 = fcmp ogt double %.0119..8, %335
  %.0119..9 = select i1 %336, double %.0119..8, double %335
  %337 = load double, ptr %308, align 16, !tbaa !10
  %338 = fcmp ogt double %.0119..9, %337
  %.0119..10 = select i1 %338, double %.0119..9, double %337
  %339 = load double, ptr %309, align 8, !tbaa !10
  %340 = fcmp ogt double %.0119..10, %339
  %.0119..11 = select i1 %340, double %.0119..10, double %339
  %341 = load double, ptr %310, align 16, !tbaa !10
  %342 = fcmp ogt double %.0119..11, %341
  %.0119..12 = select i1 %342, double %.0119..11, double %341
  %343 = load double, ptr %311, align 8, !tbaa !10
  %344 = fcmp ogt double %.0119..12, %343
  %.0119..13 = select i1 %344, double %.0119..12, double %343
  %345 = load double, ptr %312, align 16, !tbaa !10
  %346 = fcmp ogt double %.0119..13, %345
  %.0119..14 = select i1 %346, double %.0119..13, double %345
  %347 = load double, ptr %313, align 8, !tbaa !10
  %348 = fcmp ogt double %.0119..14, %347
  %.0119..15 = select i1 %348, double %.0119..14, double %347
  %349 = load double, ptr %314, align 16, !tbaa !10
  %350 = fcmp ogt double %.0119..15, %349
  %.0119..16 = select i1 %350, double %.0119..15, double %349
  %351 = load double, ptr %315, align 8, !tbaa !10
  %352 = fcmp ogt double %.0119..16, %351
  %.0119..17 = select i1 %352, double %.0119..16, double %351
  %353 = load double, ptr %316, align 16, !tbaa !10
  %354 = fcmp ogt double %.0119..17, %353
  %.0119..18 = select i1 %354, double %.0119..17, double %353
  %355 = extractelement <2 x double> %221, i64 1
  %356 = fcmp ogt double %.0119..18, %355
  %.0119..19 = select i1 %356, double %.0119..18, double %355
  %357 = extractelement <2 x double> %226, i64 0
  %358 = fcmp ogt double %.0119..19, %357
  %.0119..20 = select i1 %358, double %.0119..19, double %357
  %359 = extractelement <2 x double> %226, i64 1
  %360 = fcmp ogt double %.0119..20, %359
  %.0119..21 = select i1 %360, double %.0119..20, double %359
  %361 = extractelement <2 x double> %231, i64 0
  %362 = fcmp ogt double %.0119..21, %361
  %.0119..22 = select i1 %362, double %.0119..21, double %361
  %363 = extractelement <2 x double> %231, i64 1
  %364 = fcmp ogt double %.0119..22, %363
  %.0119..23 = select i1 %364, double %.0119..22, double %363
  %365 = extractelement <2 x double> %236, i64 0
  %366 = fcmp ogt double %.0119..23, %365
  %.0119..24 = select i1 %366, double %.0119..23, double %365
  %367 = extractelement <2 x double> %236, i64 1
  %368 = fcmp ogt double %.0119..24, %367
  %.0119..25 = select i1 %368, double %.0119..24, double %367
  %369 = extractelement <2 x double> %241, i64 0
  %370 = fcmp ogt double %.0119..25, %369
  %.0119..26 = select i1 %370, double %.0119..25, double %369
  %371 = extractelement <2 x double> %241, i64 1
  %372 = fcmp ogt double %.0119..26, %371
  %.0119..27 = select i1 %372, double %.0119..26, double %371
  %373 = extractelement <2 x double> %246, i64 0
  %374 = fcmp ogt double %.0119..27, %373
  %.0119..28 = select i1 %374, double %.0119..27, double %373
  %375 = extractelement <2 x double> %246, i64 1
  %376 = fcmp ogt double %.0119..28, %375
  %.0119..29 = select i1 %376, double %.0119..28, double %375
  %377 = extractelement <2 x double> %251, i64 0
  %378 = fcmp ogt double %.0119..29, %377
  %.0119..30 = select i1 %378, double %.0119..29, double %377
  %379 = extractelement <2 x double> %251, i64 1
  %380 = fcmp ogt double %.0119..30, %379
  %.0119..31 = select i1 %380, double %.0119..30, double %379
  %381 = extractelement <2 x double> %256, i64 0
  %382 = fcmp ogt double %.0119..31, %381
  %.0119..32 = select i1 %382, double %.0119..31, double %381
  %383 = extractelement <2 x double> %256, i64 1
  %384 = fcmp ogt double %.0119..32, %383
  %.0119..33 = select i1 %384, double %.0119..32, double %383
  %385 = extractelement <2 x double> %261, i64 0
  %386 = fcmp ogt double %.0119..33, %385
  %.0119..34 = select i1 %386, double %.0119..33, double %385
  %387 = extractelement <2 x double> %261, i64 1
  %388 = fcmp ogt double %.0119..34, %387
  %.0119..35 = select i1 %388, double %.0119..34, double %387
  store i64 0, ptr %1, align 8, !tbaa !14
  %389 = fmul double %.0119..35, 8.000000e-01
  %390 = getelementptr inbounds i8, ptr %0, i64 120
  %391 = getelementptr inbounds i8, ptr %0, i64 128
  %392 = fcmp ogt double %317, %389
  %393 = fcmp ogt double %317, %387
  %or.cond.peel = and i1 %392, %393
  %394 = fcmp ogt double %317, %319
  %or.cond135.peel = select i1 %or.cond.peel, i1 %394, i1 false
  br i1 %or.cond135.peel, label %395, label %.backedge.peel.preheader

395:                                              ; preds = %.preheader.preheader
  %396 = fsub double %319, %387
  %397 = fmul double %396, 5.000000e-01
  %398 = fadd double %387, %319
  %399 = call double @llvm.fmuladd.f64(double %317, double -2.000000e+00, double %398)
  %400 = fdiv double %397, %399
  %401 = fsub double 0.000000e+00, %400
  %402 = call double @llvm.fmuladd.f64(double %401, double 0x3FC657184AE74487, double %46)
  %403 = load i32, ptr %390, align 8, !tbaa !19
  %.not134.peel = icmp eq i32 %403, 0
  %404 = fadd double %402, 0xBFF921FB54442D18
  %.0.peel = select i1 %.not134.peel, double %402, double %404
  store double %.0.peel, ptr %391, align 8, !tbaa !23
  %405 = getelementptr inbounds i8, ptr %0, i64 136
  store double %317, ptr %405, align 8, !tbaa !25
  store i64 1, ptr %1, align 8, !tbaa !14
  br label %.backedge.peel.preheader

.backedge.peel.preheader:                         ; preds = %.preheader.preheader, %395
  %.ph = phi i64 [ 0, %.preheader.preheader ], [ 1, %395 ]
  br label %.backedge.peel

.backedge.peel:                                   ; preds = %.backedge.peel.preheader, %.backedge
  %406 = phi i64 [ %434, %.backedge ], [ %.ph, %.backedge.peel.preheader ]
  %407 = phi double [ %.pre151, %.backedge ], [ %319, %.backedge.peel.preheader ]
  %.1144 = phi i64 [ %410, %.backedge ], [ 1, %.backedge.peel.preheader ]
  %.urem = add nsw i64 %.1144, -1
  %408 = getelementptr inbounds [36 x double], ptr %4, i64 0, i64 %.urem
  %409 = load double, ptr %408, align 8, !tbaa !10
  %410 = add nuw nsw i64 %.1144, 1
  %411 = trunc nuw i64 %.1144 to i8
  %.lhs.trunc = add nuw nsw i8 %411, 37
  %412 = urem i8 %.lhs.trunc, 36
  %.zext = zext nneg i8 %412 to i64
  %413 = getelementptr inbounds [36 x double], ptr %4, i64 0, i64 %.zext
  %414 = load double, ptr %413, align 8, !tbaa !10
  %415 = fcmp ogt double %407, %389
  %416 = fcmp ogt double %407, %409
  %or.cond = select i1 %415, i1 %416, i1 false
  %417 = fcmp ogt double %407, %414
  %or.cond135 = select i1 %or.cond, i1 %417, i1 false
  br i1 %or.cond135, label %418, label %.critedge

418:                                              ; preds = %.backedge.peel
  %419 = fsub double %414, %409
  %420 = fmul double %419, 5.000000e-01
  %421 = fadd double %409, %414
  %422 = call double @llvm.fmuladd.f64(double %407, double -2.000000e+00, double %421)
  %423 = fdiv double %420, %422
  %424 = uitofp nneg i64 %.1144 to double
  %425 = fsub double %424, %423
  %426 = call double @llvm.fmuladd.f64(double %425, double 0x3FC657184AE74487, double %46)
  %427 = load i32, ptr %390, align 8, !tbaa !19
  %.not134 = icmp eq i32 %427, 0
  %428 = fadd double %426, 0xBFF921FB54442D18
  %.0 = select i1 %.not134, double %426, double %428
  %429 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %391, i64 0, i64 %406
  store double %.0, ptr %429, align 8, !tbaa !23
  %430 = getelementptr inbounds [4 x %struct._VlCovDetFeatureOrientation], ptr %391, i64 0, i64 %406, i32 1
  store double %407, ptr %430, align 8, !tbaa !25
  %431 = add i64 %406, 1
  store i64 %431, ptr %1, align 8, !tbaa !14
  %432 = icmp ult i64 %431, 4
  %433 = icmp ult i64 %.1144, 35
  %or.cond145 = and i1 %432, %433
  br i1 %or.cond145, label %.backedge, label %.loopexit

.critedge:                                        ; preds = %.backedge.peel
  %.old = icmp ult i64 %.1144, 35
  br i1 %.old, label %.backedge, label %.loopexit

.backedge:                                        ; preds = %.critedge, %418
  %434 = phi i64 [ %406, %.critedge ], [ %431, %418 ]
  %.phi.trans.insert = getelementptr inbounds [36 x double], ptr %4, i64 0, i64 %410
  %.pre151 = load double, ptr %.phi.trans.insert, align 8, !tbaa !10
  br label %.backedge.peel, !llvm.loop !26

.loopexit:                                        ; preds = %418, %.critedge
  %435 = phi i64 [ %406, %.critedge ], [ %431, %418 ]
  call void @qsort(ptr noundef nonnull %391, i64 noundef %435, i64 noundef 16, ptr noundef nonnull @_vl_covdet_compare_orientations_descending) #10
  br label %436

436:                                              ; preds = %.loopexit, %51
  %.0115 = phi ptr [ null, %51 ], [ %391, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %4) #10
  ret ptr %.0115
}

declare void @vl_imgradient_polar_f(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare hidden i32 @_vl_covdet_compare_orientations_descending(ptr noundef, ptr noundef) #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { inlinehint 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 #6 = { 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 #7 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree "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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
attributes #11 = { noreturn 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 16}
!6 = !{!"_VlFrameOrientedEllipse", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!6, !7, i64 20}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !22, i64 120}
!20 = !{!"_VlCovDet", !21, i64 0, !21, i64 8, !22, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !15, i64 48, !15, i64 56, !11, i64 64, !15, i64 72, !21, i64 80, !15, i64 88, !15, i64 96, !21, i64 104, !15, i64 112, !22, i64 120, !8, i64 128, !8, i64 192, !22, i64 256, !8, i64 260, !8, i64 6984, !8, i64 13708, !8, i64 20432, !8, i64 27156, !8, i64 31512, !8, i64 75072}
!21 = !{!"any pointer", !8, i64 0}
!22 = !{!"int", !8, i64 0}
!23 = !{!24, !11, i64 0}
!24 = !{!"_VlCovDetFeatureOrientation", !11, i64 0, !11, i64 8}
!25 = !{!24, !11, i64 8}
!26 = distinct !{!26, !17, !27}
!27 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass