; 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._Image = type { ptr, i32, double, i64, i32, i32, i32, double, double, double, i64, i64, i64, i32, i32 }
%struct._Hist = type { [12 x float] }
%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._Pyramid = type { ptr, double, double, i32, i32, i32, i32, i32 }

@stderr = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [119 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

declare void @init_im(ptr noundef) #2

declare void @im_free(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @SIFT3D_extract_dense_descriptors(ptr noundef %0, ptr noundef %1, ptr noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct._Image, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct._Hist, align 4
  %15 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 104, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._Image, ptr %16, i32 0, i32 13
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = icmp ne i32 %18, 1
  br i1 %19, label %20, label %26

20:                                               ; preds = %3
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._Image, ptr %22, i32 0, i32 13
  %24 = load i32, ptr %23, align 8, !tbaa !9
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.10, i32 noundef %24) #5
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %127

26:                                               ; preds = %3
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._SIFT3D, ptr %27, i32 0, i32 8
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = icmp ne i32 %29, 0
  %31 = zext i1 %30 to i64
  %32 = select i1 %30, ptr @extract_dense_descriptors_rotate, ptr @extract_dense_descriptors_no_rotate
  store ptr %32, ptr %8, align 8, !tbaa !5
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._Image, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._Image, ptr %35, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %36, i64 12, i1 false)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._Image, ptr %37, i32 0, i32 13
  store i32 12, ptr %38, align 8, !tbaa !9
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  call void @im_default_stride(ptr noundef %39)
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call i32 @im_resize(ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %26
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %127

44:                                               ; preds = %26
  call void @init_im(ptr noundef %9)
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = call i32 @smooth_scale_raw_input(ptr noundef %45, ptr noundef %46, ptr noundef %9)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %44
  br label %126

50:                                               ; preds = %44
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = call i32 %51(ptr noundef %52, ptr noundef %9, ptr noundef %53)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %127

57:                                               ; preds = %50
  store i32 0, ptr %12, align 4, !tbaa !22
  br label %58

58:                                               ; preds = %122, %57
  %59 = load i32, ptr %12, align 4, !tbaa !22
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._Image, ptr %60, i32 0, i32 6
  %62 = load i32, ptr %61, align 8, !tbaa !23
  %63 = icmp slt i32 %59, %62
  br i1 %63, label %64, label %125

64:                                               ; preds = %58
  store i32 0, ptr %11, align 4, !tbaa !22
  br label %65

65:                                               ; preds = %118, %64
  %66 = load i32, ptr %11, align 4, !tbaa !22
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._Image, ptr %67, i32 0, i32 5
  %69 = load i32, ptr %68, align 4, !tbaa !24
  %70 = icmp slt i32 %66, %69
  br i1 %70, label %71, label %121

71:                                               ; preds = %65
  store i32 0, ptr %10, align 4, !tbaa !22
  br label %72

72:                                               ; preds = %114, %71
  %73 = load i32, ptr %10, align 4, !tbaa !22
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._Image, ptr %74, i32 0, i32 4
  %76 = load i32, ptr %75, align 8, !tbaa !25
  %77 = icmp slt i32 %73, %76
  br i1 %77, label %78, label %117

78:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 48, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._Image, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = load i32, ptr %10, align 4, !tbaa !22
  %83 = sext i32 %82 to i64
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._Image, ptr %84, i32 0, i32 10
  %86 = load i64, ptr %85, align 8, !tbaa !27
  %87 = mul i64 %83, %86
  %88 = load i32, ptr %11, align 4, !tbaa !22
  %89 = sext i32 %88 to i64
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._Image, ptr %90, i32 0, i32 11
  %92 = load i64, ptr %91, align 8, !tbaa !28
  %93 = mul i64 %89, %92
  %94 = add i64 %87, %93
  %95 = load i32, ptr %12, align 4, !tbaa !22
  %96 = sext i32 %95 to i64
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._Image, ptr %97, i32 0, i32 12
  %99 = load i64, ptr %98, align 8, !tbaa !29
  %100 = mul i64 %96, %99
  %101 = add i64 %94, %100
  %102 = add i64 %101, 0
  %103 = getelementptr inbounds float, ptr %81, i64 %102
  %104 = load float, ptr %103, align 4, !tbaa !30
  store float %104, ptr %15, align 4, !tbaa !30
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !22
  %107 = load i32, ptr %11, align 4, !tbaa !22
  %108 = load i32, ptr %12, align 4, !tbaa !22
  call void @vox2hist(ptr noundef %105, i32 noundef %106, i32 noundef %107, i32 noundef %108, ptr noundef %14)
  %109 = load float, ptr %15, align 4, !tbaa !30
  call void @postproc_Hist(ptr noundef %14, float noundef %109)
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !22
  %112 = load i32, ptr %11, align 4, !tbaa !22
  %113 = load i32, ptr %12, align 4, !tbaa !22
  call void @hist2vox(ptr noundef %14, ptr noundef %110, i32 noundef %111, i32 noundef %112, i32 noundef %113)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #5
  br label %114

114:                                              ; preds = %78
  %115 = load i32, ptr %10, align 4, !tbaa !22
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !22
  br label %72, !llvm.loop !32

117:                                              ; preds = %72
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %11, align 4, !tbaa !22
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %11, align 4, !tbaa !22
  br label %65, !llvm.loop !34

121:                                              ; preds = %65
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %12, align 4, !tbaa !22
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !22
  br label %58, !llvm.loop !35

125:                                              ; preds = %58
  call void @im_free(ptr noundef %9)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %127

126:                                              ; preds = %49
  call void @im_free(ptr noundef %9)
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %127

127:                                              ; preds = %126, %125, %56, %43, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 104, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %128 = load i32, ptr %4, align 4
  ret i32 %128
}

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

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

declare void @im_default_stride(ptr noundef) #2

declare i32 @im_resize(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @vox2hist(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @postproc_Hist(ptr noundef, float noundef) #4

; Function Attrs: nounwind uwtable
declare hidden void @hist2vox(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !11, i64 96}
!10 = !{!"_Image", !6, i64 0, !11, i64 8, !12, i64 16, !13, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !11, i64 96, !11, i64 100}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !11, i64 296}
!15 = !{!"_SIFT3D", !16, i64 0, !17, i64 16, !20, i64 72, !21, i64 80, !21, i64 128, !10, i64 176, !12, i64 280, !12, i64 288, !11, i64 296}
!16 = !{!"_Mesh", !6, i64 0, !11, i64 8}
!17 = !{!"_GSS_filters", !18, i64 0, !6, i64 40, !11, i64 48, !11, i64 52}
!18 = !{!"_Gauss_filter", !12, i64 0, !19, i64 8}
!19 = !{!"_Sep_FIR_filter", !11, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24}
!20 = !{!"_SIFT_cl_kernels", !11, i64 0}
!21 = !{!"_Pyramid", !6, i64 0, !12, i64 8, !12, i64 16, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40}
!22 = !{!11, !11, i64 0}
!23 = !{!10, !11, i64 40}
!24 = !{!10, !11, i64 36}
!25 = !{!10, !11, i64 32}
!26 = !{!10, !6, i64 0}
!27 = !{!10, !13, i64 72}
!28 = !{!10, !13, i64 80}
!29 = !{!10, !13, i64 88}
!30 = !{!31, !31, i64 0}
!31 = !{!"float", !7, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = distinct !{!35, !33}


; 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._Image = type { ptr, i32, double, i64, i32, i32, i32, double, double, double, i64, i64, i64, i32, i32 }
%struct._Hist = type { [12 x float] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [119 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare void @init_im(ptr noundef) local_unnamed_addr #2

declare void @im_free(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @SIFT3D_extract_dense_descriptors(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #4 {
  %4 = alloca %struct._Image, align 8
  %5 = alloca %struct._Hist, align 4
  call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %4) #5
  %6 = getelementptr inbounds i8, ptr %1, i64 96
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i32 %7, 1
  br i1 %.not, label %11, label %8

8:                                                ; preds = %3
  %9 = load ptr, ptr @stderr, align 8, !tbaa !13
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.10, i32 noundef %7) #6
  br label %69

11:                                               ; preds = %3
  %12 = getelementptr inbounds i8, ptr %0, i64 296
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %.not42 = icmp eq i32 %13, 0
  %14 = select i1 %.not42, ptr @extract_dense_descriptors_no_rotate, ptr @extract_dense_descriptors_rotate
  %15 = getelementptr inbounds i8, ptr %2, i64 32
  %16 = getelementptr inbounds i8, ptr %1, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %15, ptr noundef nonnull align 8 dereferenceable(12) %16, i64 12, i1 false)
  %17 = getelementptr inbounds i8, ptr %2, i64 96
  store i32 12, ptr %17, align 8, !tbaa !5
  tail call void @im_default_stride(ptr noundef %2) #5
  %18 = tail call i32 @im_resize(ptr noundef %2) #5
  %.not43 = icmp eq i32 %18, 0
  br i1 %.not43, label %19, label %69

19:                                               ; preds = %11
  call void @init_im(ptr noundef nonnull %4) #5
  %20 = call i32 @smooth_scale_raw_input(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %4)
  %.not44 = icmp eq i32 %20, 0
  br i1 %.not44, label %21, label %68

21:                                               ; preds = %19
  %22 = call i32 %14(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %2) #5, !callees !22
  %.not45 = icmp eq i32 %22, 0
  br i1 %.not45, label %.preheader47, label %69

.preheader47:                                     ; preds = %21
  %23 = getelementptr inbounds i8, ptr %2, i64 40
  %24 = load i32, ptr %23, align 8, !tbaa !23
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.preheader46.lr.ph, label %._crit_edge53

.preheader46.lr.ph:                               ; preds = %.preheader47
  %26 = getelementptr inbounds i8, ptr %2, i64 36
  %27 = getelementptr inbounds i8, ptr %1, i64 72
  %28 = getelementptr inbounds i8, ptr %1, i64 80
  %29 = getelementptr inbounds i8, ptr %1, i64 88
  %30 = load i32, ptr %26, align 4, !tbaa !24
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.preheader46, label %._crit_edge53

.preheader46:                                     ; preds = %.preheader46.lr.ph, %._crit_edge50
  %32 = phi i32 [ %63, %._crit_edge50 ], [ %24, %.preheader46.lr.ph ]
  %33 = phi i32 [ %64, %._crit_edge50 ], [ %30, %.preheader46.lr.ph ]
  %34 = phi i32 [ %65, %._crit_edge50 ], [ %30, %.preheader46.lr.ph ]
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge50 ], [ 0, %.preheader46.lr.ph ]
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.preheader.lr.ph, label %._crit_edge50

.preheader.lr.ph:                                 ; preds = %.preheader46
  %36 = load i32, ptr %15, align 8, !tbaa !25
  %37 = icmp sgt i32 %36, 0
  br i1 %37, label %.preheader.preheader, label %._crit_edge50

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %38 = trunc nuw nsw i64 %indvars.iv60 to i32
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %39 = phi i32 [ %33, %.preheader.preheader ], [ %59, %._crit_edge ]
  %40 = phi i32 [ %36, %.preheader.preheader ], [ %60, %._crit_edge ]
  %indvars.iv57 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next58, %._crit_edge ]
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %42 = trunc nuw nsw i64 %indvars.iv57 to i32
  br label %43

43:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  %44 = load ptr, ptr %1, align 8, !tbaa !26
  %45 = load i64, ptr %27, align 8, !tbaa !27
  %46 = mul i64 %45, %indvars.iv
  %47 = load i64, ptr %28, align 8, !tbaa !28
  %48 = mul i64 %47, %indvars.iv57
  %49 = load i64, ptr %29, align 8, !tbaa !29
  %50 = mul i64 %49, %indvars.iv60
  %51 = getelementptr float, ptr %44, i64 %46
  %52 = getelementptr float, ptr %51, i64 %48
  %53 = getelementptr float, ptr %52, i64 %50
  %54 = load float, ptr %53, align 4, !tbaa !30
  %55 = trunc nuw nsw i64 %indvars.iv to i32
  call void @vox2hist(ptr noundef nonnull %2, i32 noundef %55, i32 noundef %42, i32 noundef %38, ptr noundef nonnull %5)
  call void @postproc_Hist(ptr noundef nonnull %5, float noundef %54)
  call void @hist2vox(ptr noundef nonnull %5, ptr noundef nonnull %2, i32 noundef %55, i32 noundef %42, i32 noundef %38)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %56 = load i32, ptr %15, align 8, !tbaa !25
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next, %57
  br i1 %58, label %43, label %._crit_edge.loopexit, !llvm.loop !32

._crit_edge.loopexit:                             ; preds = %43
  %.pre = load i32, ptr %26, align 4, !tbaa !24
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %59 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %39, %.preheader ]
  %60 = phi i32 [ %56, %._crit_edge.loopexit ], [ %40, %.preheader ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %61 = sext i32 %59 to i64
  %62 = icmp slt i64 %indvars.iv.next58, %61
  br i1 %62, label %.preheader, label %._crit_edge50.loopexit, !llvm.loop !34

._crit_edge50.loopexit:                           ; preds = %._crit_edge
  %.pre63 = load i32, ptr %23, align 8, !tbaa !23
  br label %._crit_edge50

._crit_edge50:                                    ; preds = %.preheader.lr.ph, %._crit_edge50.loopexit, %.preheader46
  %63 = phi i32 [ %.pre63, %._crit_edge50.loopexit ], [ %32, %.preheader46 ], [ %32, %.preheader.lr.ph ]
  %64 = phi i32 [ %59, %._crit_edge50.loopexit ], [ %33, %.preheader46 ], [ %33, %.preheader.lr.ph ]
  %65 = phi i32 [ %59, %._crit_edge50.loopexit ], [ %34, %.preheader46 ], [ %34, %.preheader.lr.ph ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %66 = sext i32 %63 to i64
  %67 = icmp slt i64 %indvars.iv.next61, %66
  br i1 %67, label %.preheader46, label %._crit_edge53, !llvm.loop !36

._crit_edge53:                                    ; preds = %._crit_edge50, %.preheader46.lr.ph, %.preheader47
  call void @im_free(ptr noundef nonnull %4) #5
  br label %69

68:                                               ; preds = %19
  call void @im_free(ptr noundef nonnull %4) #5
  br label %69

69:                                               ; preds = %21, %11, %68, %._crit_edge53, %8
  %.0 = phi i32 [ -1, %8 ], [ -1, %68 ], [ 0, %._crit_edge53 ], [ -1, %11 ], [ -1, %21 ]
  call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %4) #5
  ret i32 %.0
}

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

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

declare void @im_default_stride(ptr noundef) local_unnamed_addr #2

declare i32 @im_resize(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @vox2hist(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @postproc_Hist(ptr noundef, float noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @hist2vox(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }
attributes #6 = { cold 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, !10, i64 96}
!6 = !{!"_Image", !7, i64 0, !10, i64 8, !11, i64 16, !12, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !10, i64 96, !10, i64 100}
!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", !8, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 296}
!15 = !{!"_SIFT3D", !16, i64 0, !17, i64 16, !20, i64 72, !21, i64 80, !21, i64 128, !6, i64 176, !11, i64 280, !11, i64 288, !10, i64 296}
!16 = !{!"_Mesh", !7, i64 0, !10, i64 8}
!17 = !{!"_GSS_filters", !18, i64 0, !7, i64 40, !10, i64 48, !10, i64 52}
!18 = !{!"_Gauss_filter", !11, i64 0, !19, i64 8}
!19 = !{!"_Sep_FIR_filter", !10, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!20 = !{!"_SIFT_cl_kernels", !10, i64 0}
!21 = !{!"_Pyramid", !7, i64 0, !11, i64 8, !11, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40}
!22 = !{ptr @extract_dense_descriptors_no_rotate, ptr @extract_dense_descriptors_rotate}
!23 = !{!6, !10, i64 40}
!24 = !{!6, !10, i64 36}
!25 = !{!6, !10, i64 32}
!26 = !{!6, !7, i64 0}
!27 = !{!6, !12, i64 72}
!28 = !{!6, !12, i64 80}
!29 = !{!6, !12, i64 88}
!30 = !{!31, !31, i64 0}
!31 = !{!"float", !8, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33, !35}
!35 = !{!"llvm.loop.unswitch.partial.disable"}
!36 = distinct !{!36, !33, !35}


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