; LLVM IR from bbrister/SIFT3D :: sift3d (sift)

; 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._Keypoint_store = type { ptr, %struct._Slab, i32, i32, i32 }
%struct._Slab = type { ptr, i64, i64 }
%struct._Pyramid = type { ptr, double, double, i32, i32, i32, i32, i32 }
%struct._SIFT3D = type { %struct._Mesh, %struct._GSS_filters, %struct._SIFT_cl_kernels, %struct._Pyramid, %struct._Pyramid, %struct._Image, double, double, i32 }
%struct._Mesh = type { ptr, i32 }
%struct._GSS_filters = type { %struct._Gauss_filter, ptr, i32, i32 }
%struct._Gauss_filter = type { double, %struct._Sep_FIR_filter }
%struct._Sep_FIR_filter = type { i32, ptr, i32, i32, i32 }
%struct._SIFT_cl_kernels = type { i32 }
%struct._Image = type { ptr, i32, double, i64, i32, i32, i32, double, double, double, i64, i64, i64, i32, i32 }
%struct._Keypoint = type { [9 x float], %struct._Mat_rm, double, double, double, double, i32, i32 }
%struct._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @resize_Keypoint_store(ptr noundef, i64 noundef) #0

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

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

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

declare void @init_Pyramid(ptr noundef) #2

declare void @cleanup_Pyramid(ptr noundef) #2

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

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

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

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

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

36:                                               ; preds = %4
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %116

37:                                               ; preds = %4
  call void @init_Pyramid(ptr noundef %11)
  call void @init_Keypoint_store(ptr noundef %10)
  %38 = load double, ptr %19, align 8, !tbaa !22
  %39 = load double, ptr %20, align 8, !tbaa !22
  %40 = call i32 @set_scales_Pyramid(double noundef %38, double noundef %39, ptr noundef %11)
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = call i32 @resize_Pyramid(ptr noundef %41, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 1, ptr noundef %11)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %37
  br label %115

45:                                               ; preds = %37
  %46 = getelementptr inbounds %struct._Pyramid, ptr %11, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !24
  %48 = getelementptr inbounds %struct._Pyramid, ptr %11, i32 0, i32 4
  %49 = load i32, ptr %48, align 4, !tbaa !25
  %50 = sub nsw i32 0, %49
  %51 = getelementptr inbounds %struct._Pyramid, ptr %11, i32 0, i32 7
  %52 = load i32, ptr %51, align 8, !tbaa !26
  %53 = mul nsw i32 %50, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds %struct._Image, ptr %47, i64 %54
  %56 = getelementptr inbounds %struct._Pyramid, ptr %11, i32 0, i32 6
  %57 = load i32, ptr %56, align 4, !tbaa !27
  %58 = sub nsw i32 0, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %struct._Image, ptr %55, i64 %59
  store ptr %60, ptr %12, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = call i32 @smooth_scale_raw_input(ptr noundef %61, ptr noundef %62, ptr noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %67

66:                                               ; preds = %45
  br label %115

67:                                               ; preds = %45
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._Keypoint_store, ptr %68, i32 0, i32 1
  %70 = getelementptr inbounds %struct._Slab, ptr %69, i32 0, i32 1
  %71 = load i64, ptr %70, align 8, !tbaa !28
  %72 = call i32 @resize_Keypoint_store(ptr noundef %10, i64 noundef %71)
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %67
  br label %115

75:                                               ; preds = %67
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %105, %75
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._Keypoint_store, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds %struct._Slab, ptr %80, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !28
  %83 = icmp ult i64 %78, %82
  br i1 %83, label %84, label %108

84:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._Keypoint_store, ptr %85, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !31
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %struct._Keypoint, ptr %87, i64 %89
  store ptr %90, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %91 = getelementptr inbounds %struct._Keypoint_store, ptr %10, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !31
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds %struct._Keypoint, ptr %92, i64 %94
  store ptr %95, ptr %23, align 8, !tbaa !5
  %96 = load ptr, ptr %22, align 8, !tbaa !5
  %97 = load ptr, ptr %23, align 8, !tbaa !5
  %98 = call i32 @keypoint2base(ptr noundef %96, ptr noundef %97)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %84
  store i32 2, ptr %21, align 4
  br label %102

101:                                              ; preds = %84
  store i32 0, ptr %21, align 4
  br label %102

102:                                              ; preds = %101, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  %103 = load i32, ptr %21, align 4
  switch i32 %103, label %116 [
    i32 0, label %104
    i32 2, label %115
  ]

104:                                              ; preds = %102
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %13, align 4, !tbaa !9
  br label %76, !llvm.loop !32

108:                                              ; preds = %76
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = call i32 @_SIFT3D_extract_descriptors(ptr noundef %109, ptr noundef %11, ptr noundef %10, ptr noundef %110)
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %108
  br label %115

114:                                              ; preds = %108
  call void @cleanup_Pyramid(ptr noundef %11)
  call void @cleanup_Keypoint_store(ptr noundef %10)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %116

115:                                              ; preds = %113, %102, %74, %66, %44
  call void @cleanup_Pyramid(ptr noundef %11)
  call void @cleanup_Keypoint_store(ptr noundef %10)
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %116

116:                                              ; preds = %115, %114, %102, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %10) #3
  %117 = load i32, ptr %5, align 4
  ret i32 %117
}

declare i32 @set_scales_Pyramid(double noundef, double noundef, ptr noundef) #2

declare i32 @resize_Pyramid(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !16, i64 96}
!12 = !{!"_SIFT3D", !13, i64 0, !14, i64 16, !18, i64 72, !19, i64 80, !19, i64 128, !20, i64 176, !16, i64 280, !16, i64 288, !10, i64 296}
!13 = !{!"_Mesh", !6, i64 0, !10, i64 8}
!14 = !{!"_GSS_filters", !15, i64 0, !6, i64 40, !10, i64 48, !10, i64 52}
!15 = !{!"_Gauss_filter", !16, i64 0, !17, i64 8}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_Sep_FIR_filter", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!18 = !{!"_SIFT_cl_kernels", !10, i64 0}
!19 = !{!"_Pyramid", !6, i64 0, !16, i64 8, !16, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40}
!20 = !{!"_Image", !6, i64 0, !10, i64 8, !16, i64 16, !21, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !21, i64 72, !21, i64 80, !21, i64 88, !10, i64 96, !10, i64 100}
!21 = !{!"long", !7, i64 0}
!22 = !{!16, !16, i64 0}
!23 = !{!12, !16, i64 88}
!24 = !{!19, !6, i64 0}
!25 = !{!19, !10, i64 28}
!26 = !{!19, !10, i64 40}
!27 = !{!19, !10, i64 36}
!28 = !{!29, !21, i64 16}
!29 = !{!"_Keypoint_store", !6, i64 0, !30, i64 8, !10, i64 32, !10, i64 36, !10, i64 40}
!30 = !{!"_Slab", !6, i64 0, !21, i64 8, !21, i64 16}
!31 = !{!29, !6, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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._Keypoint_store = type { ptr, %struct._Slab, i32, i32, i32 }
%struct._Slab = type { ptr, i64, i64 }
%struct._Pyramid = type { ptr, double, double, i32, i32, i32, i32, i32 }
%struct._Image = type { ptr, i32, double, i64, i32, i32, i32, double, double, double, i64, i64, i64, i32, i32 }
%struct._Keypoint = type { [9 x float], %struct._Mat_rm, double, double, double, double, i32, i32 }
%struct._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @resize_Keypoint_store(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

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

declare void @init_Pyramid(ptr noundef) local_unnamed_addr #2

declare void @cleanup_Pyramid(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @verify_keys(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @smooth_scale_raw_input(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @keypoint2base(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @_SIFT3D_extract_descriptors(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @SIFT3D_extract_raw_descriptors(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct._Keypoint_store, align 8
  %6 = alloca %struct._Pyramid, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #3
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = load double, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  %10 = load double, ptr %9, align 8, !tbaa !20
  %11 = tail call i32 @verify_keys(ptr noundef %2, ptr noundef %1)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %45

12:                                               ; preds = %4
  call void @init_Pyramid(ptr noundef nonnull %6) #3
  call void @init_Keypoint_store(ptr noundef nonnull %5)
  %13 = call i32 @set_scales_Pyramid(double noundef %8, double noundef %10, ptr noundef nonnull %6) #3
  %14 = call i32 @resize_Pyramid(ptr noundef %1, i32 noundef 0, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 1, ptr noundef nonnull %6) #3
  %.not25 = icmp eq i32 %14, 0
  br i1 %.not25, label %15, label %.loopexit

15:                                               ; preds = %12
  %16 = load ptr, ptr %6, align 8, !tbaa !21
  %17 = getelementptr inbounds i8, ptr %6, i64 28
  %18 = load i32, ptr %17, align 4, !tbaa !22
  %19 = getelementptr inbounds i8, ptr %6, i64 40
  %20 = load i32, ptr %19, align 8, !tbaa !23
  %21 = mul i32 %18, %20
  %22 = sub i32 0, %21
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds %struct._Image, ptr %16, i64 %23
  %25 = getelementptr inbounds i8, ptr %6, i64 36
  %26 = load i32, ptr %25, align 4, !tbaa !24
  %27 = sub nsw i32 0, %26
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct._Image, ptr %24, i64 %28
  %30 = call i32 @smooth_scale_raw_input(ptr noundef nonnull %0, ptr noundef %1, ptr noundef %29)
  %.not26 = icmp eq i32 %30, 0
  br i1 %.not26, label %31, label %.loopexit

31:                                               ; preds = %15
  %32 = getelementptr inbounds i8, ptr %2, i64 16
  %33 = load i64, ptr %32, align 8, !tbaa !25
  %34 = call i32 @resize_Keypoint_store(ptr noundef nonnull %5, i64 noundef %33)
  %.not27 = icmp eq i32 %34, 0
  br i1 %.not27, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %31
  %35 = load i64, ptr %32, align 8, !tbaa !25
  %.not31 = icmp eq i64 %35, 0
  br i1 %.not31, label %._crit_edge, label %.lr.ph

36:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = load i64, ptr %32, align 8, !tbaa !25
  %38 = icmp ugt i64 %37, %indvars.iv.next
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !28

.lr.ph:                                           ; preds = %.preheader, %36
  %indvars.iv = phi i64 [ %indvars.iv.next, %36 ], [ 0, %.preheader ]
  %39 = load ptr, ptr %2, align 8, !tbaa !30
  %40 = getelementptr inbounds %struct._Keypoint, ptr %39, i64 %indvars.iv
  %41 = load ptr, ptr %5, align 8, !tbaa !30
  %42 = getelementptr inbounds %struct._Keypoint, ptr %41, i64 %indvars.iv
  %43 = call i32 @keypoint2base(ptr noundef %40, ptr noundef %42)
  %.not29 = icmp eq i32 %43, 0
  br i1 %.not29, label %36, label %.loopexit

._crit_edge:                                      ; preds = %36, %.preheader
  %44 = call i32 @_SIFT3D_extract_descriptors(ptr noundef %0, ptr noundef nonnull %6, ptr noundef nonnull %5, ptr noundef %3)
  %.not28 = icmp eq i32 %44, 0
  br i1 %.not28, label %.sink.split, label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %._crit_edge, %31, %15, %12
  br label %.sink.split

.sink.split:                                      ; preds = %._crit_edge, %.loopexit
  %.0.ph = phi i32 [ -1, %.loopexit ], [ 0, %._crit_edge ]
  call void @cleanup_Pyramid(ptr noundef nonnull %6) #3
  call void @cleanup_Keypoint_store(ptr noundef nonnull %5)
  br label %45

45:                                               ; preds = %.sink.split, %4
  %.0 = phi i32 [ -1, %4 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #3
  ret i32 %.0
}

declare i32 @set_scales_Pyramid(double noundef, double noundef, ptr noundef) local_unnamed_addr #2

declare i32 @resize_Pyramid(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

!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, !14, i64 96}
!6 = !{!"_SIFT3D", !7, i64 0, !12, i64 16, !16, i64 72, !17, i64 80, !17, i64 128, !18, i64 176, !14, i64 280, !14, i64 288, !11, i64 296}
!7 = !{!"_Mesh", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_GSS_filters", !13, i64 0, !8, i64 40, !11, i64 48, !11, i64 52}
!13 = !{!"_Gauss_filter", !14, i64 0, !15, i64 8}
!14 = !{!"double", !9, i64 0}
!15 = !{!"_Sep_FIR_filter", !11, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!16 = !{!"_SIFT_cl_kernels", !11, i64 0}
!17 = !{!"_Pyramid", !8, i64 0, !14, i64 8, !14, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40}
!18 = !{!"_Image", !8, i64 0, !11, i64 8, !14, i64 16, !19, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !19, i64 72, !19, i64 80, !19, i64 88, !11, i64 96, !11, i64 100}
!19 = !{!"long", !9, i64 0}
!20 = !{!6, !14, i64 88}
!21 = !{!17, !8, i64 0}
!22 = !{!17, !11, i64 28}
!23 = !{!17, !11, i64 40}
!24 = !{!17, !11, i64 36}
!25 = !{!26, !19, i64 16}
!26 = !{!"_Keypoint_store", !8, i64 0, !27, i64 8, !11, i64 32, !11, i64 36, !11, i64 40}
!27 = !{!"_Slab", !8, i64 0, !19, i64 8, !19, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!26, !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass