; LLVM IR from bbrister/SIFT3D :: reg (reg)

; 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._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }
%struct._Reg_SIFT3D = type { [3 x double], [3 x double], %struct._SIFT3D, %struct._Ransac, %struct._SIFT3D_Descriptor_store, %struct._SIFT3D_Descriptor_store, %struct._Mat_rm, %struct._Mat_rm, double, 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._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._Ransac = type { double, i32 }
%struct._SIFT3D_Descriptor_store = type { ptr, i64, i32, i32, i32 }

@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [57 x i8], align 1

declare i32 @init_Mat_rm(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

declare void @cleanup_Mat_rm(ptr noundef) #0

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

35:                                               ; preds = %2
  %36 = load ptr, ptr @stderr, align 8, !tbaa !5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str.2) #4
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %117

38:                                               ; preds = %2
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._SIFT3D_Descriptor_store, ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !26
  %42 = icmp ule i64 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %38
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str.3) #4
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %117

46:                                               ; preds = %38
  store ptr null, ptr %8, align 8, !tbaa !5
  %47 = call i32 @init_Mat_rm(ptr noundef %6, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %52, label %49

49:                                               ; preds = %46
  %50 = call i32 @init_Mat_rm(ptr noundef %7, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %49, %46
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.4) #4
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %117

55:                                               ; preds = %49
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = load double, ptr %14, align 8, !tbaa !25
  %59 = fptrunc double %58 to float
  %60 = call i32 @SIFT3D_nn_match(ptr noundef %56, ptr noundef %57, float noundef %59, ptr noundef %8)
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %65

62:                                               ; preds = %55
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.5) #4
  br label %115

65:                                               ; preds = %55
  %66 = load ptr, ptr %15, align 8, !tbaa !5
  %67 = load ptr, ptr %16, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load ptr, ptr %13, align 8, !tbaa !5
  %71 = call i32 @SIFT3D_matches_to_Mat_rm(ptr noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70)
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %76

73:                                               ; preds = %65
  %74 = load ptr, ptr @stderr, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.6) #4
  br label %115

76:                                               ; preds = %65
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = icmp eq ptr %77, null
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  br label %113

80:                                               ; preds = %76
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._Reg_SIFT3D, ptr %82, i32 0, i32 0
  %84 = getelementptr inbounds [3 x double], ptr %83, i64 0, i64 0
  %85 = call i32 @im2mm(ptr noundef %81, ptr noundef %84, ptr noundef %6)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %94, label %87

87:                                               ; preds = %80
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._Reg_SIFT3D, ptr %89, i32 0, i32 1
  %91 = getelementptr inbounds [3 x double], ptr %90, i64 0, i64 0
  %92 = call i32 @im2mm(ptr noundef %88, ptr noundef %91, ptr noundef %7)
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %87, %80
  br label %115

95:                                               ; preds = %87
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = call i32 @find_tform_ransac(ptr noundef %96, ptr noundef %6, ptr noundef %7, ptr noundef %97)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %95
  br label %115

101:                                              ; preds = %95
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._Reg_SIFT3D, ptr %102, i32 0, i32 0
  %104 = getelementptr inbounds [3 x double], ptr %103, i64 0, i64 0
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._Reg_SIFT3D, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds [3 x double], ptr %106, i64 0, i64 0
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = call i32 @mm2im(ptr noundef %104, ptr noundef %107, ptr noundef %108)
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %101
  br label %115

112:                                              ; preds = %101
  br label %113

113:                                              ; preds = %112, %79
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %114) #4
  call void @cleanup_Mat_rm(ptr noundef %6)
  call void @cleanup_Mat_rm(ptr noundef %7)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %117

115:                                              ; preds = %111, %100, %94, %73, %62
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %116) #4
  call void @cleanup_Mat_rm(ptr noundef %6)
  call void @cleanup_Mat_rm(ptr noundef %7)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %117

117:                                              ; preds = %115, %113, %52, %43, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #4
  %118 = load i32, ptr %3, align 4
  ret i32 %118
}

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

declare i32 @SIFT3D_nn_match(ptr noundef, ptr noundef, float noundef, ptr noundef) #0

declare i32 @SIFT3D_matches_to_Mat_rm(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

declare i32 @find_tform_ransac(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

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

attributes #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 = { 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 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !16, i64 496}
!10 = !{!"_Reg_SIFT3D", !7, i64 0, !7, i64 24, !11, i64 48, !22, i64 352, !23, i64 368, !23, i64 400, !24, i64 432, !24, i64 464, !16, i64 496, !13, i64 504}
!11 = !{!"_SIFT3D", !12, i64 0, !14, i64 16, !18, i64 72, !19, i64 80, !19, i64 128, !20, i64 176, !16, i64 280, !16, i64 288, !13, i64 296}
!12 = !{!"_Mesh", !6, i64 0, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_GSS_filters", !15, i64 0, !6, i64 40, !13, i64 48, !13, i64 52}
!15 = !{!"_Gauss_filter", !16, i64 0, !17, i64 8}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_Sep_FIR_filter", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !13, i64 24}
!18 = !{!"_SIFT_cl_kernels", !13, i64 0}
!19 = !{!"_Pyramid", !6, i64 0, !16, i64 8, !16, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40}
!20 = !{!"_Image", !6, i64 0, !13, i64 8, !16, i64 16, !21, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !21, i64 72, !21, i64 80, !21, i64 88, !13, i64 96, !13, i64 100}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_Ransac", !16, i64 0, !13, i64 8}
!23 = !{!"_SIFT3D_Descriptor_store", !6, i64 0, !21, i64 8, !13, i64 16, !13, i64 20, !13, i64 24}
!24 = !{!"_Mat_rm", !7, i64 0, !21, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28}
!25 = !{!16, !16, i64 0}
!26 = !{!23, !21, i64 8}


; 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._Mat_rm = type { %union.anon, i64, i32, i32, i32, i32 }
%union.anon = type { ptr }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [57 x i8], align 1

declare i32 @init_Mat_rm(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

declare void @cleanup_Mat_rm(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @register_SIFT3D(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct._Mat_rm, align 8
  %4 = alloca %struct._Mat_rm, align 8
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 352
  %7 = getelementptr inbounds i8, ptr %0, i64 432
  %8 = getelementptr inbounds i8, ptr %0, i64 464
  %9 = getelementptr inbounds i8, ptr %0, i64 496
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 368
  %12 = getelementptr inbounds i8, ptr %0, i64 400
  %13 = getelementptr inbounds i8, ptr %0, i64 376
  %14 = load i64, ptr %13, align 8, !tbaa !24
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %16, label %19

16:                                               ; preds = %2
  %17 = load ptr, ptr @stderr, align 8, !tbaa !25
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.2) #6
  br label %56

19:                                               ; preds = %2
  %20 = getelementptr inbounds i8, ptr %0, i64 408
  %21 = load i64, ptr %20, align 8, !tbaa !24
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %19
  %24 = load ptr, ptr @stderr, align 8, !tbaa !25
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.3) #6
  br label %56

26:                                               ; preds = %19
  store ptr null, ptr %5, align 8, !tbaa !25
  %27 = call i32 @init_Mat_rm(ptr noundef nonnull %3, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0) #5
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %28, label %30

28:                                               ; preds = %26
  %29 = call i32 @init_Mat_rm(ptr noundef nonnull %4, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0) #5
  %.not26 = icmp eq i32 %29, 0
  br i1 %.not26, label %33, label %30

30:                                               ; preds = %28, %26
  %31 = load ptr, ptr @stderr, align 8, !tbaa !25
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.4) #6
  br label %56

33:                                               ; preds = %28
  %34 = fptrunc double %10 to float
  %35 = call i32 @SIFT3D_nn_match(ptr noundef nonnull %11, ptr noundef nonnull %12, float noundef %34, ptr noundef nonnull %5) #5
  %.not27 = icmp eq i32 %35, 0
  br i1 %.not27, label %36, label %.sink.split

36:                                               ; preds = %33
  %37 = load ptr, ptr %5, align 8, !tbaa !25
  %38 = call i32 @SIFT3D_matches_to_Mat_rm(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef %37, ptr noundef nonnull %7, ptr noundef nonnull %8) #5
  %.not28 = icmp eq i32 %38, 0
  br i1 %.not28, label %39, label %.sink.split

39:                                               ; preds = %36
  %40 = icmp eq ptr %1, null
  br i1 %40, label %50, label %41

41:                                               ; preds = %39
  %42 = call i32 @im2mm(ptr noundef nonnull %7, ptr noundef nonnull %0, ptr noundef nonnull %3)
  %.not29 = icmp eq i32 %42, 0
  br i1 %.not29, label %43, label %54

43:                                               ; preds = %41
  %44 = getelementptr inbounds i8, ptr %0, i64 24
  %45 = call i32 @im2mm(ptr noundef nonnull %8, ptr noundef nonnull %44, ptr noundef nonnull %4)
  %.not30 = icmp eq i32 %45, 0
  br i1 %.not30, label %46, label %54

46:                                               ; preds = %43
  %47 = call i32 @find_tform_ransac(ptr noundef nonnull %6, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %1) #5
  %.not31 = icmp eq i32 %47, 0
  br i1 %.not31, label %48, label %54

48:                                               ; preds = %46
  %49 = call i32 @mm2im(ptr noundef nonnull %0, ptr noundef nonnull %44, ptr noundef nonnull %1)
  %.not32 = icmp eq i32 %49, 0
  br i1 %.not32, label %50, label %54

50:                                               ; preds = %48, %39
  %51 = load ptr, ptr %5, align 8, !tbaa !25
  call void @free(ptr noundef %51) #5
  call void @cleanup_Mat_rm(ptr noundef nonnull %3) #5
  call void @cleanup_Mat_rm(ptr noundef nonnull %4) #5
  br label %56

.sink.split:                                      ; preds = %36, %33
  %.str.6.sink = phi ptr [ @.str.5, %33 ], [ @.str.6, %36 ]
  %52 = load ptr, ptr @stderr, align 8, !tbaa !25
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull %.str.6.sink) #6
  br label %54

54:                                               ; preds = %.sink.split, %48, %46, %41, %43
  %55 = load ptr, ptr %5, align 8, !tbaa !25
  call void @free(ptr noundef %55) #5
  call void @cleanup_Mat_rm(ptr noundef nonnull %3) #5
  call void @cleanup_Mat_rm(ptr noundef nonnull %4) #5
  br label %56

56:                                               ; preds = %54, %50, %30, %23, %16
  %.0 = phi i32 [ -1, %16 ], [ -1, %23 ], [ -1, %30 ], [ -1, %54 ], [ 0, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret i32 %.0
}

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

declare i32 @SIFT3D_nn_match(ptr noundef, ptr noundef, float noundef, ptr noundef) local_unnamed_addr #0

declare i32 @SIFT3D_matches_to_Mat_rm(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare i32 @find_tform_ransac(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

attributes #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 = { 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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, !15, i64 496}
!6 = !{!"_Reg_SIFT3D", !7, i64 0, !7, i64 24, !9, i64 48, !21, i64 352, !22, i64 368, !22, i64 400, !23, i64 432, !23, i64 464, !15, i64 496, !12, i64 504}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"_SIFT3D", !10, i64 0, !13, i64 16, !17, i64 72, !18, i64 80, !18, i64 128, !19, i64 176, !15, i64 280, !15, i64 288, !12, i64 296}
!10 = !{!"_Mesh", !11, i64 0, !12, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_GSS_filters", !14, i64 0, !11, i64 40, !12, i64 48, !12, i64 52}
!14 = !{!"_Gauss_filter", !15, i64 0, !16, i64 8}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_Sep_FIR_filter", !12, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !12, i64 24}
!17 = !{!"_SIFT_cl_kernels", !12, i64 0}
!18 = !{!"_Pyramid", !11, i64 0, !15, i64 8, !15, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40}
!19 = !{!"_Image", !11, i64 0, !12, i64 8, !15, i64 16, !20, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !20, i64 72, !20, i64 80, !20, i64 88, !12, i64 96, !12, i64 100}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_Ransac", !15, i64 0, !12, i64 8}
!22 = !{!"_SIFT3D_Descriptor_store", !11, i64 0, !20, i64 8, !12, i64 16, !12, i64 20, !12, i64 24}
!23 = !{!"_Mat_rm", !7, i64 0, !20, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!24 = !{!22, !20, i64 8}
!25 = !{!11, !11, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass