; LLVM IR from QiaoLiuHit/LSOTB-TIR :: vlfeat-0.9.19/vl (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._VlSiftFilt = type { double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, i32, i32, ptr, double, i64, ptr, i32, i32, double, double, double, double, double, ptr, i32 }

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

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #1

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @vl_sift_process_first_octave(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %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 double, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  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 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  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 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._VlSiftFilt, ptr %26, i32 0, i32 12
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  store ptr %28, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._VlSiftFilt, ptr %29, i32 0, i32 4
  %31 = load i32, ptr %30, align 8, !tbaa !14
  store i32 %31, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._VlSiftFilt, ptr %32, i32 0, i32 5
  %34 = load i32, ptr %33, align 4, !tbaa !16
  store i32 %34, ptr %15, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._VlSiftFilt, ptr %35, i32 0, i32 8
  %37 = load i32, ptr %36, align 8, !tbaa !17
  store i32 %37, ptr %16, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._VlSiftFilt, ptr %38, i32 0, i32 9
  %40 = load i32, ptr %39, align 4, !tbaa !18
  store i32 %40, ptr %17, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._VlSiftFilt, ptr %41, i32 0, i32 10
  %43 = load i32, ptr %42, align 8, !tbaa !19
  store i32 %43, ptr %18, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._VlSiftFilt, ptr %44, i32 0, i32 1
  %46 = load double, ptr %45, align 8, !tbaa !20
  store double %46, ptr %19, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._VlSiftFilt, ptr %47, i32 0, i32 2
  %49 = load double, ptr %48, align 8, !tbaa !22
  store double %49, ptr %20, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._VlSiftFilt, ptr %50, i32 0, i32 0
  %52 = load double, ptr %51, align 8, !tbaa !23
  store double %52, ptr %21, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._VlSiftFilt, ptr %53, i32 0, i32 3
  %55 = load double, ptr %54, align 8, !tbaa !24
  store double %55, ptr %22, align 8, !tbaa !21
  %56 = load i32, ptr %16, align 4, !tbaa !15
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._VlSiftFilt, ptr %57, i32 0, i32 11
  store i32 %56, ptr %58, align 4, !tbaa !25
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._VlSiftFilt, ptr %59, i32 0, i32 21
  store i32 0, ptr %60, align 8, !tbaa !26
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct._VlSiftFilt, ptr %61, i32 0, i32 11
  %63 = load i32, ptr %62, align 4, !tbaa !25
  %64 = sub nsw i32 0, %63
  %65 = icmp sge i32 %64, 0
  br i1 %65, label %66, label %75

66:                                               ; preds = %2
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._VlSiftFilt, ptr %67, i32 0, i32 4
  %69 = load i32, ptr %68, align 8, !tbaa !14
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct._VlSiftFilt, ptr %70, i32 0, i32 11
  %72 = load i32, ptr %71, align 4, !tbaa !25
  %73 = sub nsw i32 0, %72
  %74 = shl i32 %69, %73
  br label %85

75:                                               ; preds = %2
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._VlSiftFilt, ptr %76, i32 0, i32 4
  %78 = load i32, ptr %77, align 8, !tbaa !14
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._VlSiftFilt, ptr %79, i32 0, i32 11
  %81 = load i32, ptr %80, align 4, !tbaa !25
  %82 = sub nsw i32 0, %81
  %83 = sub nsw i32 0, %82
  %84 = ashr i32 %78, %83
  br label %85

85:                                               ; preds = %75, %66
  %86 = phi i32 [ %74, %66 ], [ %84, %75 ]
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._VlSiftFilt, ptr %87, i32 0, i32 15
  store i32 %86, ptr %88, align 8, !tbaa !27
  store i32 %86, ptr %9, align 4, !tbaa !15
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._VlSiftFilt, ptr %89, i32 0, i32 11
  %91 = load i32, ptr %90, align 4, !tbaa !25
  %92 = sub nsw i32 0, %91
  %93 = icmp sge i32 %92, 0
  br i1 %93, label %94, label %103

94:                                               ; preds = %85
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._VlSiftFilt, ptr %95, i32 0, i32 5
  %97 = load i32, ptr %96, align 4, !tbaa !16
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._VlSiftFilt, ptr %98, i32 0, i32 11
  %100 = load i32, ptr %99, align 4, !tbaa !25
  %101 = sub nsw i32 0, %100
  %102 = shl i32 %97, %101
  br label %113

103:                                              ; preds = %85
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._VlSiftFilt, ptr %104, i32 0, i32 5
  %106 = load i32, ptr %105, align 4, !tbaa !16
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._VlSiftFilt, ptr %107, i32 0, i32 11
  %109 = load i32, ptr %108, align 4, !tbaa !25
  %110 = sub nsw i32 0, %109
  %111 = sub nsw i32 0, %110
  %112 = ashr i32 %106, %111
  br label %113

113:                                              ; preds = %103, %94
  %114 = phi i32 [ %102, %94 ], [ %112, %103 ]
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct._VlSiftFilt, ptr %115, i32 0, i32 16
  store i32 %114, ptr %116, align 4, !tbaa !28
  store i32 %114, ptr %8, align 4, !tbaa !15
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._VlSiftFilt, ptr %117, i32 0, i32 6
  %119 = load i32, ptr %118, align 8, !tbaa !29
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %122

121:                                              ; preds = %113
  store i32 5, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %253

122:                                              ; preds = %113
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = load i32, ptr %17, align 4, !tbaa !15
  %125 = call ptr @vl_sift_get_octave(ptr noundef %123, i32 noundef %124)
  store ptr %125, ptr %12, align 8, !tbaa !5
  %126 = load i32, ptr %16, align 4, !tbaa !15
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %168

128:                                              ; preds = %122
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = load i32, ptr %14, align 4, !tbaa !15
  %132 = load i32, ptr %15, align 4, !tbaa !15
  call void @copy_and_upsample_rows(ptr noundef %129, ptr noundef %130, i32 noundef %131, i32 noundef %132)
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = load i32, ptr %15, align 4, !tbaa !15
  %136 = load i32, ptr %14, align 4, !tbaa !15
  %137 = mul nsw i32 2, %136
  call void @copy_and_upsample_rows(ptr noundef %133, ptr noundef %134, i32 noundef %135, i32 noundef %137)
  store i32 -1, ptr %6, align 4, !tbaa !15
  br label %138

138:                                              ; preds = %164, %128
  %139 = load i32, ptr %6, align 4, !tbaa !15
  %140 = load i32, ptr %16, align 4, !tbaa !15
  %141 = icmp sgt i32 %139, %140
  br i1 %141, label %142, label %167

142:                                              ; preds = %138
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = load i32, ptr %14, align 4, !tbaa !15
  %146 = load i32, ptr %6, align 4, !tbaa !15
  %147 = sub nsw i32 0, %146
  %148 = shl i32 %145, %147
  %149 = load i32, ptr %15, align 4, !tbaa !15
  %150 = load i32, ptr %6, align 4, !tbaa !15
  %151 = sub nsw i32 0, %150
  %152 = shl i32 %149, %151
  call void @copy_and_upsample_rows(ptr noundef %143, ptr noundef %144, i32 noundef %148, i32 noundef %152)
  %153 = load ptr, ptr %12, align 8, !tbaa !5
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = load i32, ptr %14, align 4, !tbaa !15
  %156 = load i32, ptr %6, align 4, !tbaa !15
  %157 = sub nsw i32 0, %156
  %158 = shl i32 %155, %157
  %159 = load i32, ptr %15, align 4, !tbaa !15
  %160 = load i32, ptr %6, align 4, !tbaa !15
  %161 = sub nsw i32 0, %160
  %162 = shl i32 %159, %161
  %163 = mul nsw i32 2, %162
  call void @copy_and_upsample_rows(ptr noundef %153, ptr noundef %154, i32 noundef %158, i32 noundef %163)
  br label %164

164:                                              ; preds = %142
  %165 = load i32, ptr %6, align 4, !tbaa !15
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr %6, align 4, !tbaa !15
  br label %138, !llvm.loop !30

167:                                              ; preds = %138
  br label %187

168:                                              ; preds = %122
  %169 = load i32, ptr %16, align 4, !tbaa !15
  %170 = icmp sgt i32 %169, 0
  br i1 %170, label %171, label %177

171:                                              ; preds = %168
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = load i32, ptr %14, align 4, !tbaa !15
  %175 = load i32, ptr %15, align 4, !tbaa !15
  %176 = load i32, ptr %16, align 4, !tbaa !15
  call void @copy_and_downsample(ptr noundef %172, ptr noundef %173, i32 noundef %174, i32 noundef %175, i32 noundef %176)
  br label %186

177:                                              ; preds = %168
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = load i32, ptr %14, align 4, !tbaa !15
  %181 = sext i32 %180 to i64
  %182 = mul i64 4, %181
  %183 = load i32, ptr %15, align 4, !tbaa !15
  %184 = sext i32 %183 to i64
  %185 = mul i64 %182, %184
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %178, ptr align 4 %179, i64 %185, i1 false)
  br label %186

186:                                              ; preds = %177, %171
  br label %187

187:                                              ; preds = %186, %167
  %188 = load double, ptr %19, align 8, !tbaa !21
  %189 = load double, ptr %20, align 8, !tbaa !21
  %190 = load i32, ptr %17, align 4, !tbaa !15
  %191 = sitofp i32 %190 to double
  %192 = call double @pow(double noundef %189, double noundef %191) #6
  %193 = fmul double %188, %192
  store double %193, ptr %10, align 8, !tbaa !21
  %194 = load double, ptr %21, align 8, !tbaa !21
  %195 = load i32, ptr %16, align 4, !tbaa !15
  %196 = sub nsw i32 0, %195
  %197 = sitofp i32 %196 to double
  %198 = call double @pow(double noundef 2.000000e+00, double noundef %197) #6
  %199 = fmul double %194, %198
  store double %199, ptr %11, align 8, !tbaa !21
  %200 = load double, ptr %10, align 8, !tbaa !21
  %201 = load double, ptr %11, align 8, !tbaa !21
  %202 = fcmp ogt double %200, %201
  br i1 %202, label %203, label %221

203:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %204 = load double, ptr %10, align 8, !tbaa !21
  %205 = load double, ptr %10, align 8, !tbaa !21
  %206 = load double, ptr %11, align 8, !tbaa !21
  %207 = load double, ptr %11, align 8, !tbaa !21
  %208 = fmul double %206, %207
  %209 = fneg double %208
  %210 = call double @llvm.fmuladd.f64(double %204, double %205, double %209)
  %211 = call double @sqrt(double noundef %210) #6
  store double %211, ptr %24, align 8, !tbaa !21
  %212 = load ptr, ptr %4, align 8, !tbaa !5
  %213 = load ptr, ptr %12, align 8, !tbaa !5
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = load i32, ptr %9, align 4, !tbaa !15
  %217 = sext i32 %216 to i64
  %218 = load i32, ptr %8, align 4, !tbaa !15
  %219 = sext i32 %218 to i64
  %220 = load double, ptr %24, align 8, !tbaa !21
  call void @_vl_sift_smooth(ptr noundef %212, ptr noundef %213, ptr noundef %214, ptr noundef %215, i64 noundef %217, i64 noundef %219, double noundef %220)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %221

221:                                              ; preds = %203, %187
  %222 = load i32, ptr %17, align 4, !tbaa !15
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %7, align 4, !tbaa !15
  br label %224

224:                                              ; preds = %249, %221
  %225 = load i32, ptr %7, align 4, !tbaa !15
  %226 = load i32, ptr %18, align 4, !tbaa !15
  %227 = icmp sle i32 %225, %226
  br i1 %227, label %228, label %252

228:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %229 = load double, ptr %22, align 8, !tbaa !21
  %230 = load double, ptr %20, align 8, !tbaa !21
  %231 = load i32, ptr %7, align 4, !tbaa !15
  %232 = sitofp i32 %231 to double
  %233 = call double @pow(double noundef %230, double noundef %232) #6
  %234 = fmul double %229, %233
  store double %234, ptr %25, align 8, !tbaa !21
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = load i32, ptr %7, align 4, !tbaa !15
  %238 = call ptr @vl_sift_get_octave(ptr noundef %236, i32 noundef %237)
  %239 = load ptr, ptr %13, align 8, !tbaa !5
  %240 = load ptr, ptr %4, align 8, !tbaa !5
  %241 = load i32, ptr %7, align 4, !tbaa !15
  %242 = sub nsw i32 %241, 1
  %243 = call ptr @vl_sift_get_octave(ptr noundef %240, i32 noundef %242)
  %244 = load i32, ptr %9, align 4, !tbaa !15
  %245 = sext i32 %244 to i64
  %246 = load i32, ptr %8, align 4, !tbaa !15
  %247 = sext i32 %246 to i64
  %248 = load double, ptr %25, align 8, !tbaa !21
  call void @_vl_sift_smooth(ptr noundef %235, ptr noundef %238, ptr noundef %239, ptr noundef %243, i64 noundef %245, i64 noundef %247, double noundef %248)
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %249

249:                                              ; preds = %228
  %250 = load i32, ptr %7, align 4, !tbaa !15
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %7, align 4, !tbaa !15
  br label %224, !llvm.loop !32

252:                                              ; preds = %224
  store i32 0, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %253

253:                                              ; preds = %252, %121
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %254 = load i32, ptr %3, align 4
  ret i32 %254
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @vl_sift_get_octave(ptr noundef, i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @copy_and_downsample(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 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) #4

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

; Function Attrs: nounwind uwtable
declare hidden void @_vl_sift_smooth(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, double 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !6, i64 64}
!10 = !{!"_VlSiftFilt", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !6, i64 96, !11, i64 104, !13, i64 112, !6, i64 120, !12, i64 128, !12, i64 132, !11, i64 136, !11, i64 144, !11, i64 152, !11, i64 160, !11, i64 168, !6, i64 176, !12, i64 184}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!10, !12, i64 32}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !12, i64 36}
!17 = !{!10, !12, i64 48}
!18 = !{!10, !12, i64 52}
!19 = !{!10, !12, i64 56}
!20 = !{!10, !11, i64 8}
!21 = !{!11, !11, i64 0}
!22 = !{!10, !11, i64 16}
!23 = !{!10, !11, i64 0}
!24 = !{!10, !11, i64 24}
!25 = !{!10, !12, i64 60}
!26 = !{!10, !12, i64 128}
!27 = !{!10, !12, i64 88}
!28 = !{!10, !12, i64 92}
!29 = !{!10, !12, i64 40}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}


; 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"

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 6) i32 @vl_sift_process_first_octave(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 64
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = load i32, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 36
  %8 = load i32, ptr %7, align 4, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 48
  %10 = load i32, ptr %9, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 52
  %12 = load i32, ptr %11, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load i32, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load double, ptr %15, align 8, !tbaa !18
  %17 = load <2 x double>, ptr %0, align 8, !tbaa !19
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load double, ptr %18, align 8, !tbaa !20
  %20 = getelementptr inbounds i8, ptr %0, i64 60
  store i32 %10, ptr %20, align 4, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %0, i64 128
  store i32 0, ptr %21, align 8, !tbaa !22
  %22 = icmp slt i32 %10, 1
  br i1 %22, label %23, label %27

23:                                               ; preds = %2
  %24 = sub nsw i32 0, %10
  %25 = shl i32 %6, %24
  %26 = shl i32 %8, %24
  br label %30

27:                                               ; preds = %2
  %28 = ashr i32 %6, %10
  %29 = ashr i32 %8, %10
  br label %30

30:                                               ; preds = %27, %23
  %.sink = phi i32 [ %25, %23 ], [ %28, %27 ]
  %31 = phi i32 [ %26, %23 ], [ %29, %27 ]
  %32 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 %.sink, ptr %32, align 8
  %33 = getelementptr inbounds i8, ptr %0, i64 92
  store i32 %31, ptr %33, align 4, !tbaa !23
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  %35 = load i32, ptr %34, align 8, !tbaa !24
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %.loopexit, label %37

37:                                               ; preds = %30
  %38 = tail call ptr @vl_sift_get_octave(ptr noundef nonnull %0, i32 noundef %12)
  %39 = icmp slt i32 %10, 0
  br i1 %39, label %40, label %48

40:                                               ; preds = %37
  tail call void @copy_and_upsample_rows(ptr noundef %4, ptr noundef %1, i32 noundef %6, i32 noundef %8)
  %41 = shl nsw i32 %6, 1
  tail call void @copy_and_upsample_rows(ptr noundef %38, ptr noundef %4, i32 noundef %8, i32 noundef %41)
  %.not109 = icmp eq i32 %10, -1
  br i1 %.not109, label %.loopexit104, label %.lr.ph

.lr.ph:                                           ; preds = %40, %.lr.ph
  %.096105 = phi i32 [ %46, %.lr.ph ], [ -1, %40 ]
  %42 = sub nsw i32 0, %.096105
  %43 = shl i32 %6, %42
  %44 = shl i32 %8, %42
  tail call void @copy_and_upsample_rows(ptr noundef %4, ptr noundef %38, i32 noundef %43, i32 noundef %44)
  %45 = shl nsw i32 %44, 1
  tail call void @copy_and_upsample_rows(ptr noundef %38, ptr noundef %4, i32 noundef %43, i32 noundef %45)
  %46 = add nsw i32 %.096105, -1
  %47 = icmp sgt i32 %46, %10
  br i1 %47, label %.lr.ph, label %.loopexit104, !llvm.loop !25

48:                                               ; preds = %37
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %50, label %49

49:                                               ; preds = %48
  tail call void @copy_and_downsample(ptr noundef %38, ptr noundef %1, i32 noundef %6, i32 noundef %8, i32 noundef %10)
  br label %.loopexit104

50:                                               ; preds = %48
  %51 = sext i32 %6 to i64
  %52 = shl nsw i64 %51, 2
  %53 = sext i32 %8 to i64
  %54 = mul i64 %52, %53
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %1, i64 %54, i1 false)
  br label %.loopexit104

.loopexit104:                                     ; preds = %.lr.ph, %40, %49, %50
  %55 = sitofp i32 %12 to double
  %56 = tail call double @pow(double noundef %16, double noundef %55) #6
  %57 = sub nsw i32 0, %10
  %ldexp = tail call double @ldexp(double 1.000000e+00, i32 %57) #6
  %58 = insertelement <2 x double> poison, double %ldexp, i64 0
  %59 = insertelement <2 x double> %58, double %56, i64 1
  %60 = fmul <2 x double> %17, %59
  %61 = extractelement <2 x double> %60, i64 0
  %62 = extractelement <2 x double> %60, i64 1
  %63 = fcmp ogt double %62, %61
  br i1 %63, label %64, label %71

64:                                               ; preds = %.loopexit104
  %65 = fneg double %61
  %66 = fmul double %61, %65
  %67 = tail call double @llvm.fmuladd.f64(double %62, double %62, double %66)
  %68 = tail call double @sqrt(double noundef %67) #6
  %69 = sext i32 %.sink to i64
  %70 = sext i32 %31 to i64
  tail call void @_vl_sift_smooth(ptr noundef nonnull %0, ptr noundef %38, ptr noundef %4, ptr noundef %38, i64 noundef %69, i64 noundef %70, double noundef %68)
  br label %71

71:                                               ; preds = %64, %.loopexit104
  %.not103.not106 = icmp slt i32 %12, %14
  br i1 %.not103.not106, label %.lr.ph108, label %.loopexit

.lr.ph108:                                        ; preds = %71
  %72 = sext i32 %.sink to i64
  %73 = sext i32 %31 to i64
  br label %74

74:                                               ; preds = %.lr.ph108, %74
  %.097.in107 = phi i32 [ %12, %.lr.ph108 ], [ %.097, %74 ]
  %.097 = add nsw i32 %.097.in107, 1
  %75 = sitofp i32 %.097 to double
  %76 = tail call double @pow(double noundef %16, double noundef %75) #6
  %77 = fmul double %19, %76
  %78 = tail call ptr @vl_sift_get_octave(ptr noundef nonnull %0, i32 noundef %.097)
  %79 = tail call ptr @vl_sift_get_octave(ptr noundef nonnull %0, i32 noundef %.097.in107)
  tail call void @_vl_sift_smooth(ptr noundef nonnull %0, ptr noundef %78, ptr noundef %4, ptr noundef %79, i64 noundef %72, i64 noundef %73, double noundef %77)
  %exitcond.not = icmp eq i32 %.097, %14
  br i1 %exitcond.not, label %.loopexit, label %74, !llvm.loop !27

.loopexit:                                        ; preds = %74, %71, %30
  %.0 = phi i32 [ 5, %30 ], [ 0, %71 ], [ 0, %74 ]
  ret i32 %.0
}

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

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

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

; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nounwind uwtable
declare hidden void @_vl_sift_smooth(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, double noundef) local_unnamed_addr #1

; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) local_unnamed_addr #5

attributes #0 = { mustprogress nofree nounwind willreturn memory(write) "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 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 #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree willreturn }
attributes #6 = { 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, !11, i64 64}
!6 = !{!"_VlSiftFilt", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !11, i64 64, !11, i64 72, !11, i64 80, !10, i64 88, !10, i64 92, !11, i64 96, !7, i64 104, !12, i64 112, !11, i64 120, !10, i64 128, !10, i64 132, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !11, i64 176, !10, i64 184}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!6, !10, i64 32}
!14 = !{!6, !10, i64 36}
!15 = !{!6, !10, i64 48}
!16 = !{!6, !10, i64 52}
!17 = !{!6, !10, i64 56}
!18 = !{!6, !7, i64 16}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !7, i64 24}
!21 = !{!6, !10, i64 60}
!22 = !{!6, !10, i64 128}
!23 = !{!6, !10, i64 92}
!24 = !{!6, !10, i64 40}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass