; 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.option = type { ptr, i32, ptr, i32 }

@stderr = external global ptr, align 8
@__const.parse_args_SIFT3D.longopts = external hidden unnamed_addr constant [6 x %struct.option], align 16
@opterr = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@optind = external global i32, align 4
@optarg = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [54 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 void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_peak_thresh_SIFT3D(ptr noundef, double noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_corner_thresh_SIFT3D(ptr noundef, double noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_sigma_n_SIFT3D(ptr noundef, double noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_sigma0_SIFT3D(ptr noundef, double noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_args_SIFT3D(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca [6 x %struct.option], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 192, ptr %16) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %16, ptr align 16 @__const.parse_args_SIFT3D.longopts, i64 192, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %20 = load i32, ptr @opterr, align 4, !tbaa !9
  store i32 %20, ptr %17, align 4, !tbaa !9
  %21 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %21, ptr @opterr, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = call noalias ptr @calloc(i64 noundef %23, i64 noundef 8) #7
  store ptr %24, ptr %10, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %29

26:                                               ; preds = %4
  %27 = load ptr, ptr @stderr, align 8, !tbaa !5
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.5) #6
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %156

29:                                               ; preds = %4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %138, %136, %29
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds [6 x %struct.option], ptr %16, i64 0, i64 0
  %34 = call i32 @getopt_long(i32 noundef %31, ptr noundef %32, ptr noundef @.str.6, ptr noundef %33, ptr noundef null) #6
  store i32 %34, ptr %12, align 4, !tbaa !9
  %35 = icmp ne i32 %34, -1
  br i1 %35, label %36, label %139

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %37 = load i32, ptr @optind, align 4, !tbaa !9
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr %19, align 4, !tbaa !9
  %39 = load ptr, ptr @optarg, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %46

41:                                               ; preds = %36
  %42 = load ptr, ptr @optarg, align 8, !tbaa !5
  %43 = call double @atof(ptr noundef %42) #8
  store double %43, ptr %11, align 8, !tbaa !11
  %44 = load ptr, ptr @optarg, align 8, !tbaa !5
  %45 = call i32 @atoi(ptr noundef %44) #8
  store i32 %45, ptr %14, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %41, %36
  %47 = load i32, ptr %12, align 4, !tbaa !9
  switch i32 %47, label %130 [
    i32 97, label %48
    i32 98, label %64
    i32 99, label %80
    i32 100, label %103
    i32 101, label %116
    i32 63, label %129
  ]

48:                                               ; preds = %46
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load double, ptr %11, align 8, !tbaa !11
  %51 = call i32 @set_peak_thresh_SIFT3D(ptr noundef %49, double noundef %50)
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  store i32 5, ptr %18, align 4
  br label %136

54:                                               ; preds = %48
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %55, i64 %58
  store i8 1, ptr %59, align 1, !tbaa !13
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i32, ptr %19, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %60, i64 %62
  store i8 1, ptr %63, align 1, !tbaa !13
  br label %135

64:                                               ; preds = %46
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = load double, ptr %11, align 8, !tbaa !11
  %67 = call i32 @set_corner_thresh_SIFT3D(ptr noundef %65, double noundef %66)
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %64
  store i32 5, ptr %18, align 4
  br label %136

70:                                               ; preds = %64
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = load i32, ptr %19, align 4, !tbaa !9
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %71, i64 %74
  store i8 1, ptr %75, align 1, !tbaa !13
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load i32, ptr %19, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %76, i64 %78
  store i8 1, ptr %79, align 1, !tbaa !13
  br label %135

80:                                               ; preds = %46
  %81 = load i32, ptr %14, align 4, !tbaa !9
  %82 = icmp sle i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %80
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str.7, i32 noundef %85) #6
  store i32 5, ptr %18, align 4
  br label %136

87:                                               ; preds = %80
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = call i32 @set_num_kp_levels_SIFT3D(ptr noundef %88, i32 noundef %89)
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %87
  store i32 5, ptr %18, align 4
  br label %136

93:                                               ; preds = %87
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = load i32, ptr %19, align 4, !tbaa !9
  %96 = sub nsw i32 %95, 1
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %94, i64 %97
  store i8 1, ptr %98, align 1, !tbaa !13
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = load i32, ptr %19, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %99, i64 %101
  store i8 1, ptr %102, align 1, !tbaa !13
  br label %135

103:                                              ; preds = %46
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load double, ptr %11, align 8, !tbaa !11
  %106 = call i32 @set_sigma_n_SIFT3D(ptr noundef %104, double noundef %105)
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = load i32, ptr %19, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i8, ptr %107, i64 %110
  store i8 1, ptr %111, align 1, !tbaa !13
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = load i32, ptr %19, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i8, ptr %112, i64 %114
  store i8 1, ptr %115, align 1, !tbaa !13
  br label %135

116:                                              ; preds = %46
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = load double, ptr %11, align 8, !tbaa !11
  %119 = call i32 @set_sigma0_SIFT3D(ptr noundef %117, double noundef %118)
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = load i32, ptr %19, align 4, !tbaa !9
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %120, i64 %123
  store i8 1, ptr %124, align 1, !tbaa !13
  %125 = load ptr, ptr %10, align 8, !tbaa !5
  %126 = load i32, ptr %19, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i8, ptr %125, i64 %127
  store i8 1, ptr %128, align 1, !tbaa !13
  br label %135

129:                                              ; preds = %46
  br label %130

130:                                              ; preds = %129, %46
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %134, label %133

133:                                              ; preds = %130
  store i32 2, ptr %18, align 4
  br label %136, !llvm.loop !14

134:                                              ; preds = %130
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %135

135:                                              ; preds = %134, %116, %103, %93, %70, %54
  store i32 0, ptr %18, align 4
  br label %136

136:                                              ; preds = %135, %133, %92, %83, %69, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %137 = load i32, ptr %18, align 4
  switch i32 %137, label %156 [
    i32 0, label %138
    i32 2, label %30
    i32 5, label %154
  ]

138:                                              ; preds = %136
  br label %30, !llvm.loop !14

139:                                              ; preds = %30
  %140 = load i32, ptr %7, align 4, !tbaa !9
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = call i32 @argv_remove(i32 noundef %140, ptr noundef %141, ptr noundef %142)
  store i32 %143, ptr %15, align 4, !tbaa !9
  %144 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %144, ptr @opterr, align 4, !tbaa !9
  %145 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %145) #6
  %146 = load i32, ptr %9, align 4, !tbaa !9
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %152

148:                                              ; preds = %139
  %149 = load i32, ptr %13, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %148
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %156

152:                                              ; preds = %148, %139
  store i32 0, ptr @optind, align 4, !tbaa !9
  %153 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %153, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %156

154:                                              ; preds = %136
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %155) #6
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %156

156:                                              ; preds = %154, %152, %151, %136, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 192, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, 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
  %157 = load i32, ptr %5, align 4
  ret i32 %157
}

; 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 allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #5

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

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

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 = { 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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind allocsize(0,1) "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 willreturn memory(read) 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 = { nounwind allocsize(0,1) }
attributes #8 = { nounwind willreturn memory(read) }

!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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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.option = type { ptr, i32, ptr, i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@__const.parse_args_SIFT3D.longopts = external hidden unnamed_addr constant [6 x %struct.option], align 16
@opterr = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@optind = external local_unnamed_addr global i32, align 4
@optarg = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [54 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_peak_thresh_SIFT3D(ptr noundef, double noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_corner_thresh_SIFT3D(ptr noundef, double noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_sigma_n_SIFT3D(ptr noundef, double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @set_sigma0_SIFT3D(ptr noundef, double noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @parse_args_SIFT3D(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca [6 x %struct.option], align 16
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %5) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(192) %5, ptr noundef nonnull align 16 dereferenceable(192) @__const.parse_args_SIFT3D.longopts, i64 192, i1 false)
  %6 = load i32, ptr @opterr, align 4, !tbaa !5
  store i32 %3, ptr @opterr, align 4, !tbaa !5
  %7 = sext i32 %1 to i64
  %8 = tail call noalias ptr @calloc(i64 noundef %7, i64 noundef 8) #9
  %9 = icmp eq ptr %8, null
  br i1 %9, label %11, label %.preheader

.preheader:                                       ; preds = %4
  %invariant.gep = getelementptr i8, ptr %8, i64 -2
  %10 = call i32 @getopt_long(i32 noundef %1, ptr noundef %2, ptr noundef nonnull @.str.6, ptr noundef nonnull %5, ptr noundef null) #8
  %.not77 = icmp eq i32 %10, -1
  br i1 %.not77, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %.not62 = icmp eq i32 %3, 0
  br label %14

11:                                               ; preds = %4
  %12 = load ptr, ptr @stderr, align 8, !tbaa !9
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.5) #10
  br label %62

14:                                               ; preds = %.lr.ph, %select.unfold
  %15 = phi i32 [ %10, %.lr.ph ], [ %57, %select.unfold ]
  %.05080 = phi double [ undef, %.lr.ph ], [ %.1, %select.unfold ]
  %.05179 = phi i32 [ 0, %.lr.ph ], [ %.2, %select.unfold ]
  %.05378 = phi i32 [ undef, %.lr.ph ], [ %.154, %select.unfold ]
  %16 = load i32, ptr @optind, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  %18 = load ptr, ptr @optarg, align 8, !tbaa !9
  %.not58 = icmp eq ptr %18, null
  br i1 %.not58, label %22, label %19

19:                                               ; preds = %14
  %20 = call double @atof(ptr noundef %18) #11
  %21 = call i32 @atoi(ptr nocapture noundef %18) #11
  br label %22

22:                                               ; preds = %19, %14
  %.154 = phi i32 [ %21, %19 ], [ %.05378, %14 ]
  %.1 = phi double [ %20, %19 ], [ %.05080, %14 ]
  switch i32 %15, label %56 [
    i32 97, label %23
    i32 98, label %29
    i32 99, label %35
    i32 100, label %46
    i32 101, label %51
  ]

23:                                               ; preds = %22
  %24 = call i32 @set_peak_thresh_SIFT3D(ptr noundef %0, double noundef %.1)
  %.not61 = icmp eq i32 %24, 0
  br i1 %.not61, label %25, label %.loopexit

25:                                               ; preds = %23
  %26 = sext i32 %16 to i64
  %gep76 = getelementptr i8, ptr %invariant.gep, i64 %26
  store i8 1, ptr %gep76, align 1, !tbaa !11
  %27 = sext i32 %17 to i64
  %28 = getelementptr inbounds i8, ptr %8, i64 %27
  store i8 1, ptr %28, align 1, !tbaa !11
  br label %select.unfold

29:                                               ; preds = %22
  %30 = call i32 @set_corner_thresh_SIFT3D(ptr noundef %0, double noundef %.1)
  %.not60 = icmp eq i32 %30, 0
  br i1 %.not60, label %31, label %.loopexit

31:                                               ; preds = %29
  %32 = sext i32 %16 to i64
  %gep74 = getelementptr i8, ptr %invariant.gep, i64 %32
  store i8 1, ptr %gep74, align 1, !tbaa !11
  %33 = sext i32 %17 to i64
  %34 = getelementptr inbounds i8, ptr %8, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !11
  br label %select.unfold

35:                                               ; preds = %22
  %36 = icmp slt i32 %.154, 1
  br i1 %36, label %37, label %40

37:                                               ; preds = %35
  %38 = load ptr, ptr @stderr, align 8, !tbaa !9
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.7, i32 noundef %.154) #10
  br label %.loopexit

40:                                               ; preds = %35
  %41 = call i32 @set_num_kp_levels_SIFT3D(ptr noundef %0, i32 noundef %.154)
  %.not59 = icmp eq i32 %41, 0
  br i1 %.not59, label %42, label %.loopexit

42:                                               ; preds = %40
  %43 = sext i32 %16 to i64
  %gep72 = getelementptr i8, ptr %invariant.gep, i64 %43
  store i8 1, ptr %gep72, align 1, !tbaa !11
  %44 = sext i32 %17 to i64
  %45 = getelementptr inbounds i8, ptr %8, i64 %44
  store i8 1, ptr %45, align 1, !tbaa !11
  br label %select.unfold

46:                                               ; preds = %22
  %47 = call i32 @set_sigma_n_SIFT3D(ptr noundef %0, double noundef %.1)
  %48 = sext i32 %16 to i64
  %gep70 = getelementptr i8, ptr %invariant.gep, i64 %48
  store i8 1, ptr %gep70, align 1, !tbaa !11
  %49 = sext i32 %17 to i64
  %50 = getelementptr inbounds i8, ptr %8, i64 %49
  store i8 1, ptr %50, align 1, !tbaa !11
  br label %select.unfold

51:                                               ; preds = %22
  %52 = call i32 @set_sigma0_SIFT3D(ptr noundef %0, double noundef %.1)
  %53 = sext i32 %16 to i64
  %gep = getelementptr i8, ptr %invariant.gep, i64 %53
  store i8 1, ptr %gep, align 1, !tbaa !11
  %54 = sext i32 %17 to i64
  %55 = getelementptr inbounds i8, ptr %8, i64 %54
  store i8 1, ptr %55, align 1, !tbaa !11
  br label %select.unfold

56:                                               ; preds = %22
  %spec.select = select i1 %.not62, i32 %.05179, i32 1
  br label %select.unfold, !llvm.loop !12

select.unfold:                                    ; preds = %56, %25, %31, %42, %46, %51
  %.2 = phi i32 [ %.05179, %51 ], [ %.05179, %46 ], [ %.05179, %42 ], [ %.05179, %31 ], [ %.05179, %25 ], [ %spec.select, %56 ]
  %57 = call i32 @getopt_long(i32 noundef %1, ptr noundef %2, ptr noundef nonnull @.str.6, ptr noundef nonnull %5, ptr noundef null) #8
  %.not = icmp eq i32 %57, -1
  br i1 %.not, label %._crit_edge.loopexit, label %14

._crit_edge.loopexit:                             ; preds = %select.unfold
  %58 = icmp ne i32 %.2, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.051.lcssa = phi i1 [ false, %.preheader ], [ %58, %._crit_edge.loopexit ]
  %59 = call i32 @argv_remove(i32 noundef %1, ptr noundef %2, ptr noundef nonnull %8)
  store i32 %6, ptr @opterr, align 4, !tbaa !5
  call void @free(ptr noundef %8) #8
  %60 = icmp ne i32 %3, 0
  %or.cond = select i1 %60, i1 %.051.lcssa, i1 false
  br i1 %or.cond, label %62, label %61

61:                                               ; preds = %._crit_edge
  store i32 0, ptr @optind, align 4, !tbaa !5
  br label %62

.loopexit:                                        ; preds = %23, %29, %40, %37
  call void @free(ptr noundef %8) #8
  br label %62

62:                                               ; preds = %._crit_edge, %.loopexit, %61, %11
  %.0 = phi i32 [ -1, %11 ], [ -1, %.loopexit ], [ %59, %61 ], [ -1, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %5) #8
  ret i32 %.0
}

; 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) #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i32 @getopt_long(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #7

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

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass