; LLVM IR from vlfeat/vlfeat :: 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._VlScaleSpaceGeometry = type { i64, i64, i64, i64, i64, i64, i64, double, double }
%struct._VlCovDet = type { ptr, ptr, i32, double, double, double, i64, i64, i64, double, 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], i32 }
%struct._VlCovDetFeatureOrientation = type { double, double }
%struct._VlCovDetFeatureLaplacianScale = type { double, double }

@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_covdet_put_image = external hidden unnamed_addr constant [69 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 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: nounwind
declare double @pow(double noundef, double noundef) #2

declare void @vl_scalespace_delete(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @vl_covdet_put_image(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %struct._VlScaleSpaceGeometry, align 8
  %15 = alloca %struct._VlScaleSpaceGeometry, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 16, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %14) #6
  %17 = load i64, ptr %8, align 8, !tbaa !9
  %18 = load i64, ptr %9, align 8, !tbaa !9
  call void @vl_scalespace_get_default_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8 %14, i64 noundef %17, i64 noundef %18)
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  br label %23

22:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 1703, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

23:                                               ; preds = %21
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  br label %28

27:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 1704, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

28:                                               ; preds = %26
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = icmp uge i64 %29, 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  br label %33

32:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 1705, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

33:                                               ; preds = %31
  %34 = load i64, ptr %9, align 8, !tbaa !9
  %35 = icmp uge i64 %34, 1
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  br label %38

37:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 1706, ptr noundef @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

38:                                               ; preds = %36
  %39 = load i64, ptr %8, align 8, !tbaa !9
  %40 = uitofp i64 %39 to double
  %41 = fsub double %40, 1.000000e+00
  %42 = load i64, ptr %9, align 8, !tbaa !9
  %43 = uitofp i64 %42 to double
  %44 = fsub double %43, 1.000000e+00
  %45 = fcmp olt double %41, %44
  br i1 %45, label %46, label %50

46:                                               ; preds = %38
  %47 = load i64, ptr %8, align 8, !tbaa !9
  %48 = uitofp i64 %47 to double
  %49 = fsub double %48, 1.000000e+00
  br label %54

50:                                               ; preds = %38
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = uitofp i64 %51 to double
  %53 = fsub double %52, 1.000000e+00
  br label %54

54:                                               ; preds = %50, %46
  %55 = phi double [ %49, %46 ], [ %53, %50 ]
  %56 = fdiv double %55, 1.500000e+01
  %57 = call double @vl_log2_d(double noundef %56)
  %58 = call i64 @vl_floor_d(double noundef %57)
  store i64 %58, ptr %11, align 8, !tbaa !9
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._VlCovDet, ptr %59, i32 0, i32 7
  %61 = load i64, ptr %60, align 8, !tbaa !11
  %62 = icmp sgt i64 %61, 0
  br i1 %62, label %63, label %87

63:                                               ; preds = %54
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._VlCovDet, ptr %64, i32 0, i32 7
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._VlCovDet, ptr %67, i32 0, i32 8
  %69 = load i64, ptr %68, align 8, !tbaa !15
  %70 = sub nsw i64 %66, %69
  %71 = sub nsw i64 %70, 1
  %72 = load i64, ptr %11, align 8, !tbaa !9
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %74, label %83

74:                                               ; preds = %63
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._VlCovDet, ptr %75, i32 0, i32 7
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._VlCovDet, ptr %78, i32 0, i32 8
  %80 = load i64, ptr %79, align 8, !tbaa !15
  %81 = sub nsw i64 %77, %80
  %82 = sub nsw i64 %81, 1
  br label %85

83:                                               ; preds = %63
  %84 = load i64, ptr %11, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %83, %74
  %86 = phi i64 [ %82, %74 ], [ %84, %83 ]
  store i64 %86, ptr %11, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %85, %54
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._VlCovDet, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !16
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %97

92:                                               ; preds = %87
  store i64 -1, ptr %12, align 8, !tbaa !9
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct._VlCovDet, ptr %93, i32 0, i32 6
  %95 = load i64, ptr %94, align 8, !tbaa !17
  %96 = add i64 %95, 1
  store i64 %96, ptr %13, align 8, !tbaa !9
  br label %112

97:                                               ; preds = %87
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._VlCovDet, ptr %98, i32 0, i32 2
  %100 = load i32, ptr %99, align 8, !tbaa !16
  %101 = icmp eq i32 %100, 2
  br i1 %101, label %102, label %106

102:                                              ; preds = %97
  store i64 -1, ptr %12, align 8, !tbaa !9
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._VlCovDet, ptr %103, i32 0, i32 6
  %105 = load i64, ptr %104, align 8, !tbaa !17
  store i64 %105, ptr %13, align 8, !tbaa !9
  br label %111

106:                                              ; preds = %97
  store i64 0, ptr %12, align 8, !tbaa !9
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._VlCovDet, ptr %107, i32 0, i32 6
  %109 = load i64, ptr %108, align 8, !tbaa !17
  %110 = sub i64 %109, 1
  store i64 %110, ptr %13, align 8, !tbaa !9
  br label %111

111:                                              ; preds = %106, %102
  br label %112

112:                                              ; preds = %111, %92
  %113 = load i64, ptr %8, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 0
  store i64 %113, ptr %114, align 8, !tbaa !18
  %115 = load i64, ptr %9, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 1
  store i64 %115, ptr %116, align 8, !tbaa !20
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._VlCovDet, ptr %117, i32 0, i32 8
  %119 = load i64, ptr %118, align 8, !tbaa !15
  %120 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 2
  store i64 %119, ptr %120, align 8, !tbaa !21
  %121 = load i64, ptr %11, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 3
  store i64 %121, ptr %122, align 8, !tbaa !22
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._VlCovDet, ptr %123, i32 0, i32 6
  %125 = load i64, ptr %124, align 8, !tbaa !17
  %126 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 4
  store i64 %125, ptr %126, align 8, !tbaa !23
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._VlCovDet, ptr %127, i32 0, i32 9
  %129 = load double, ptr %128, align 8, !tbaa !24
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._VlCovDet, ptr %130, i32 0, i32 6
  %132 = load i64, ptr %131, align 8, !tbaa !17
  %133 = uitofp i64 %132 to double
  %134 = fdiv double 1.000000e+00, %133
  %135 = call double @pow(double noundef 2.000000e+00, double noundef %134) #6
  %136 = fmul double %129, %135
  %137 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 7
  store double %136, ptr %137, align 8, !tbaa !25
  %138 = load i64, ptr %12, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 5
  store i64 %138, ptr %139, align 8, !tbaa !26
  %140 = load i64, ptr %13, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct._VlScaleSpaceGeometry, ptr %14, i32 0, i32 6
  store i64 %140, ptr %141, align 8, !tbaa !27
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._VlCovDet, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !28
  %145 = icmp eq ptr %144, null
  br i1 %145, label %152, label %146

146:                                              ; preds = %112
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct._VlCovDet, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !28
  call void @vl_scalespace_get_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8 %15, ptr noundef %149)
  %150 = call i32 @vl_scalespacegeometry_is_equal(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8 %14, ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8 %15)
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %171, label %152

152:                                              ; preds = %146, %112
  %153 = load ptr, ptr %6, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._VlCovDet, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !28
  %156 = icmp ne ptr %155, null
  br i1 %156, label %157, label %161

157:                                              ; preds = %152
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct._VlCovDet, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !28
  call void @vl_scalespace_delete(ptr noundef %160)
  br label %161

161:                                              ; preds = %157, %152
  %162 = call ptr @vl_scalespace_new_with_geometry(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8 %14)
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._VlCovDet, ptr %163, i32 0, i32 0
  store ptr %162, ptr %164, align 8, !tbaa !28
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._VlCovDet, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !28
  %168 = icmp eq ptr %167, null
  br i1 %168, label %169, label %170

169:                                              ; preds = %161
  store i32 2, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %176

170:                                              ; preds = %161
  br label %171

171:                                              ; preds = %170, %146
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct._VlCovDet, ptr %172, i32 0, i32 0
  %174 = load ptr, ptr %173, align 8, !tbaa !28
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  call void @vl_scalespace_put_image(ptr noundef %174, ptr noundef %175)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %16, align 4
  br label %176

176:                                              ; preds = %171, %169
  call void @llvm.lifetime.end.p0(i64 72, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %177 = load i32, ptr %5, align 4
  ret i32 %177
}

declare void @vl_scalespace_get_default_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8, i64 noundef, i64 noundef) #3

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

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

declare i32 @vl_scalespacegeometry_is_equal(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8, ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8) #3

declare void @vl_scalespace_get_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8, ptr noundef) #3

declare ptr @vl_scalespace_new_with_geometry(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8) #3

declare void @vl_scalespace_put_image(ptr noundef, ptr noundef) #3

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 }
attributes #7 = { 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 = !{!"long long", !7, i64 0}
!11 = !{!12, !10, i64 56}
!12 = !{!"_VlCovDet", !6, i64 0, !6, i64 8, !13, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !14, i64 72, !10, i64 80, !14, i64 88, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 120, !6, i64 128, !10, i64 136, !13, i64 144, !7, i64 152, !7, i64 216, !13, i64 280, !7, i64 284, !7, i64 7008, !7, i64 13732, !7, i64 20456, !7, i64 27180, !7, i64 31536, !7, i64 75096, !13, i64 75136}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!12, !10, i64 64}
!16 = !{!12, !13, i64 16}
!17 = !{!12, !10, i64 48}
!18 = !{!19, !10, i64 0}
!19 = !{!"_VlScaleSpaceGeometry", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !14, i64 56, !14, i64 64}
!20 = !{!19, !10, i64 8}
!21 = !{!19, !10, i64 16}
!22 = !{!19, !10, i64 24}
!23 = !{!19, !10, i64 32}
!24 = !{!12, !14, i64 72}
!25 = !{!19, !14, i64 56}
!26 = !{!19, !10, i64 40}
!27 = !{!19, !10, i64 48}
!28 = !{!12, !6, i64 0}


; 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._VlScaleSpaceGeometry = type { i64, i64, i64, i64, i64, i64, i64, double, double }

@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@__PRETTY_FUNCTION__.vl_covdet_put_image = external hidden unnamed_addr constant [69 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 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

declare void @vl_scalespace_delete(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @vl_covdet_put_image(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct._VlScaleSpaceGeometry, align 8
  %6 = alloca %struct._VlScaleSpaceGeometry, align 8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #6
  call void @vl_scalespace_get_default_geometry(ptr dead_on_unwind nonnull writable sret(%struct._VlScaleSpaceGeometry) align 8 %5, i64 noundef %2, i64 noundef %3) #6
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %8

7:                                                ; preds = %4
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 1703, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

8:                                                ; preds = %4
  %.not54 = icmp eq ptr %1, null
  br i1 %.not54, label %9, label %10

9:                                                ; preds = %8
  call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 1704, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

10:                                               ; preds = %8
  %.not55 = icmp eq i64 %2, 0
  br i1 %.not55, label %11, label %12

11:                                               ; preds = %10
  call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 1705, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

12:                                               ; preds = %10
  %.not56 = icmp eq i64 %3, 0
  br i1 %.not56, label %13, label %14

13:                                               ; preds = %12
  call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 1706, ptr noundef nonnull @__PRETTY_FUNCTION__.vl_covdet_put_image) #7
  unreachable

14:                                               ; preds = %12
  %15 = insertelement <2 x i64> poison, i64 %2, i64 0
  %16 = insertelement <2 x i64> %15, i64 %3, i64 1
  %17 = uitofp <2 x i64> %16 to <2 x double>
  %18 = fadd <2 x double> %17, <double -1.000000e+00, double -1.000000e+00>
  %19 = extractelement <2 x double> %18, i64 0
  %20 = extractelement <2 x double> %18, i64 1
  %21 = fcmp olt double %19, %20
  %. = select i1 %21, double %19, double %20
  %22 = fdiv double %., 1.500000e+01
  %23 = call double @vl_log2_d(double noundef %22)
  %24 = call i64 @vl_floor_d(double noundef %23)
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %28, label %33

28:                                               ; preds = %14
  %29 = getelementptr inbounds i8, ptr %0, i64 64
  %30 = load i64, ptr %29, align 8, !tbaa !13
  %31 = xor i64 %30, -1
  %32 = add i64 %26, %31
  %.59 = call i64 @llvm.smin.i64(i64 %32, i64 %24)
  br label %33

33:                                               ; preds = %28, %14
  %.040 = phi i64 [ %.59, %28 ], [ %24, %14 ]
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  %35 = load i32, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %0, i64 48
  %37 = load i64, ptr %36, align 8, !tbaa !15
  switch i32 %35, label %40 [
    i32 1, label %38
    i32 2, label %42
  ]

38:                                               ; preds = %33
  %39 = add i64 %37, 1
  br label %42

40:                                               ; preds = %33
  %41 = add i64 %37, -1
  br label %42

42:                                               ; preds = %33, %40, %38
  %.039 = phi i64 [ -1, %38 ], [ 0, %40 ], [ -1, %33 ]
  %.0 = phi i64 [ %39, %38 ], [ %41, %40 ], [ %37, %33 ]
  store i64 %2, ptr %5, align 8, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 %3, ptr %43, align 8, !tbaa !18
  %44 = getelementptr inbounds i8, ptr %0, i64 64
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = getelementptr inbounds i8, ptr %5, i64 16
  store i64 %45, ptr %46, align 8, !tbaa !19
  %47 = getelementptr inbounds i8, ptr %5, i64 24
  store i64 %.040, ptr %47, align 8, !tbaa !20
  %48 = getelementptr inbounds i8, ptr %5, i64 32
  store i64 %37, ptr %48, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %0, i64 72
  %50 = load double, ptr %49, align 8, !tbaa !22
  %51 = uitofp i64 %37 to double
  %52 = fdiv double 1.000000e+00, %51
  %exp2 = call double @exp2(double %52) #6
  %53 = fmul double %50, %exp2
  %54 = getelementptr inbounds i8, ptr %5, i64 56
  store double %53, ptr %54, align 8, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %5, i64 40
  store i64 %.039, ptr %55, align 8, !tbaa !24
  %56 = getelementptr inbounds i8, ptr %5, i64 48
  store i64 %.0, ptr %56, align 8, !tbaa !25
  %57 = load ptr, ptr %0, align 8, !tbaa !26
  %58 = icmp eq ptr %57, null
  br i1 %58, label %.thread, label %59

59:                                               ; preds = %42
  call void @vl_scalespace_get_geometry(ptr dead_on_unwind nonnull writable sret(%struct._VlScaleSpaceGeometry) align 8 %6, ptr noundef nonnull %57) #6
  %60 = call i32 @vl_scalespacegeometry_is_equal(ptr noundef nonnull byval(%struct._VlScaleSpaceGeometry) align 8 %5, ptr noundef nonnull byval(%struct._VlScaleSpaceGeometry) align 8 %6) #6
  %.not57 = icmp eq i32 %60, 0
  %.pre = load ptr, ptr %0, align 8, !tbaa !26
  br i1 %.not57, label %61, label %65

61:                                               ; preds = %59
  %.not58 = icmp eq ptr %.pre, null
  br i1 %.not58, label %.thread, label %62

62:                                               ; preds = %61
  call void @vl_scalespace_delete(ptr noundef nonnull %.pre) #6
  br label %.thread

.thread:                                          ; preds = %42, %62, %61
  %63 = call ptr @vl_scalespace_new_with_geometry(ptr noundef nonnull byval(%struct._VlScaleSpaceGeometry) align 8 %5) #6
  store ptr %63, ptr %0, align 8, !tbaa !26
  %64 = icmp eq ptr %63, null
  br i1 %64, label %67, label %65

65:                                               ; preds = %.thread, %59
  %66 = phi ptr [ %63, %.thread ], [ %.pre, %59 ]
  call void @vl_scalespace_put_image(ptr noundef %66, ptr noundef nonnull %1) #6
  br label %67

67:                                               ; preds = %.thread, %65
  %.041 = phi i32 [ 0, %65 ], [ 2, %.thread ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #6
  ret i32 %.041
}

declare void @vl_scalespace_get_default_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8, i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @vl_log2_d(double noundef) local_unnamed_addr #4

declare i32 @vl_scalespacegeometry_is_equal(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8, ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8) local_unnamed_addr #2

declare void @vl_scalespace_get_geometry(ptr dead_on_unwind writable sret(%struct._VlScaleSpaceGeometry) align 8, ptr noundef) local_unnamed_addr #2

declare ptr @vl_scalespace_new_with_geometry(ptr noundef byval(%struct._VlScaleSpaceGeometry) align 8) local_unnamed_addr #2

declare void @vl_scalespace_put_image(ptr noundef, ptr noundef) local_unnamed_addr #2

declare double @exp2(double) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5

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 = { "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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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, !12, i64 56}
!6 = !{!"_VlCovDet", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !11, i64 72, !12, i64 80, !11, i64 88, !12, i64 96, !7, i64 104, !12, i64 112, !12, i64 120, !7, i64 128, !12, i64 136, !10, i64 144, !8, i64 152, !8, i64 216, !10, i64 280, !8, i64 284, !8, i64 7008, !8, i64 13732, !8, i64 20456, !8, i64 27180, !8, i64 31536, !8, i64 75096, !10, i64 75136}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!6, !12, i64 64}
!14 = !{!6, !10, i64 16}
!15 = !{!6, !12, i64 48}
!16 = !{!17, !12, i64 0}
!17 = !{!"_VlScaleSpaceGeometry", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !11, i64 56, !11, i64 64}
!18 = !{!17, !12, i64 8}
!19 = !{!17, !12, i64 16}
!20 = !{!17, !12, i64 24}
!21 = !{!17, !12, i64 32}
!22 = !{!6, !11, i64 72}
!23 = !{!17, !11, i64 56}
!24 = !{!17, !12, i64 40}
!25 = !{!17, !12, i64 48}
!26 = !{!6, !7, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass