; LLVM IR from openxrlab/xrsfm :: 3rdparty/SiftGPU/SiftMatch.ll (ZN11SiftMatchGL18SetFeautreLocationEiPKfi)

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

%class.SiftMatchGL = type { %class.SiftMatchGPU.base, [4 x i8], [2 x %class.GLTexImage], [2 x %class.GLTexImage], %class.GLTexImage, [2 x %class.GLTexImage], ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], [2 x i32], [2 x i32], i32, i32, i32, i32, i32, %"class.std::vector" }
%class.SiftMatchGPU.base = type <{ ptr, i32, i32, ptr, i32 }>
%class.GLTexImage = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@_ZN11GlobalParam10_texTargetE = external global i32, align 4

; 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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36)) #4

declare void @glTexSubImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #4

declare void @_ZN10GLTexImage9UnbindTexEv() #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11SiftMatchGL18SetFeautreLocationEiPKfi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %17 = load ptr, ptr %5, align 8
  %18 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 22
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [2 x i32], ptr %18, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = icmp sle i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %4
  br label %167

25:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %26 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 27
  %27 = load i32, ptr %26, align 8, !tbaa !11
  store i32 %27, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %28 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 22
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [2 x i32], ptr %28, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 27
  %34 = load i32, ptr %33, align 8, !tbaa !11
  %35 = add nsw i32 %32, %34
  %36 = sub nsw i32 %35, 1
  %37 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 27
  %38 = load i32, ptr %37, align 8, !tbaa !11
  %39 = sdiv i32 %36, %38
  store i32 %39, ptr %10, align 4, !tbaa !9
  %40 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %41 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 22
  %42 = load i32, ptr %6, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [2 x i32], ptr %41, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = mul nsw i32 %45, 2
  %47 = sext i32 %46 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %40, i64 noundef %47)
  %48 = load i32, ptr %8, align 4, !tbaa !9
  %49 = icmp eq i32 %48, 0
  br i1 %49, label %50, label %62

50:                                               ; preds = %25
  %51 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef 0) #5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 22
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2 x i32], ptr %54, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = mul nsw i32 %58, 2
  %60 = sext i32 %59 to i64
  %61 = mul i64 %60, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %53, i64 %61, i1 false)
  br label %98

62:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %94, %62
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 22
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [2 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp slt i32 %64, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %97

72:                                               ; preds = %63
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds float, ptr %73, i32 1
  store ptr %74, ptr %7, align 8, !tbaa !5
  %75 = load float, ptr %73, align 4, !tbaa !19
  %76 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = mul nsw i32 %77, 2
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %76, i64 noundef %79) #5
  store float %75, ptr %80, align 4, !tbaa !19
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds float, ptr %81, i32 1
  store ptr %82, ptr %7, align 8, !tbaa !5
  %83 = load float, ptr %81, align 4, !tbaa !19
  %84 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = mul nsw i32 %85, 2
  %87 = add nsw i32 %86, 1
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %88) #5
  store float %83, ptr %89, align 4, !tbaa !19
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = sext i32 %90 to i64
  %93 = getelementptr inbounds float, ptr %91, i64 %92
  store ptr %93, ptr %7, align 8, !tbaa !5
  br label %94

94:                                               ; preds = %72
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %11, align 4, !tbaa !9
  br label %63, !llvm.loop !21

97:                                               ; preds = %71
  br label %98

98:                                               ; preds = %97, %50
  %99 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = mul nsw i32 %100, %101
  %103 = mul nsw i32 %102, 2
  %104 = sext i32 %103 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store float 0.000000e+00, ptr %12, align 4, !tbaa !19
  call void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef %104, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %105 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 2
  %106 = load i32, ptr %6, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [2 x %class.GLTexImage], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = load ptr, ptr %108, align 8, !tbaa !23
  %112 = getelementptr inbounds ptr, ptr %111, i64 5
  %113 = load ptr, ptr %112, align 8
  call void %113(ptr noundef nonnull align 8 dereferenceable(36) %108, i32 noundef %109, i32 noundef %110)
  %114 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 2
  %115 = load i32, ptr %6, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [2 x %class.GLTexImage], ptr %114, i64 0, i64 %116
  call void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %117)
  %118 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 26
  %119 = load i32, ptr %118, align 4, !tbaa !25
  %120 = icmp eq i32 %119, 1
  br i1 %120, label %121, label %127

121:                                              ; preds = %98
  %122 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !9
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %125, i64 noundef 0) #5
  call void @glTexSubImage2D(i32 noundef %122, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %123, i32 noundef %124, i32 noundef 6410, i32 noundef 5126, ptr noundef %126)
  br label %158

127:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %154, %127
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 26
  %131 = load i32, ptr %130, align 4, !tbaa !25
  %132 = icmp slt i32 %129, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %157

134:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %135 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 25
  %136 = load i32, ptr %135, align 8, !tbaa !26
  store i32 %136, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %137 = load i32, ptr %13, align 4, !tbaa !9
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = mul nsw i32 %137, %138
  store i32 %139, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = load i32, ptr %14, align 4, !tbaa !9
  %142 = mul nsw i32 %140, %141
  %143 = load i32, ptr %10, align 4, !tbaa !9
  %144 = mul nsw i32 %142, %143
  %145 = mul nsw i32 %144, 2
  store i32 %145, ptr %16, align 4, !tbaa !9
  %146 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !9
  %147 = load i32, ptr %15, align 4, !tbaa !9
  %148 = load i32, ptr %14, align 4, !tbaa !9
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 30
  %151 = load i32, ptr %16, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %150, i64 noundef %152) #5
  call void @glTexSubImage2D(i32 noundef %146, i32 noundef 0, i32 noundef %147, i32 noundef 0, i32 noundef %148, i32 noundef %149, i32 noundef 6410, i32 noundef 5126, ptr noundef %153)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %154

154:                                              ; preds = %134
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %13, align 4, !tbaa !9
  br label %128, !llvm.loop !27

157:                                              ; preds = %133
  br label %158

158:                                              ; preds = %157, %121
  %159 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 2
  %160 = load i32, ptr %6, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [2 x %class.GLTexImage], ptr %159, i64 0, i64 %161
  call void @_ZN10GLTexImage9UnbindTexEv()
  %163 = getelementptr inbounds %class.SiftMatchGL, ptr %17, i32 0, i32 24
  %164 = load i32, ptr %6, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [2 x i32], ptr %163, i64 0, i64 %165
  store i32 1, ptr %166, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %167

167:                                              ; preds = %158, %24
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = { "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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 424}
!12 = !{!"_ZTS11SiftMatchGL", !13, i64 0, !7, i64 32, !7, i64 112, !14, i64 192, !7, i64 232, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !10, i64 388, !7, i64 392, !7, i64 400, !7, i64 408, !10, i64 416, !10, i64 420, !10, i64 424, !10, i64 428, !10, i64 432, !15, i64 440}
!13 = !{!"_ZTS12SiftMatchGPU", !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!14 = !{!"_ZTS10GLTexImage", !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!15 = !{!"_ZTSSt6vectorIfSaIfEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!12, !10, i64 420}
!26 = !{!12, !10, i64 416}
!27 = distinct !{!27, !22}


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

%class.GLTexImage = type <{ ptr, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>

@_ZN11GlobalParam10_texTargetE = external local_unnamed_addr global i32, align 4

; 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 uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 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: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4

declare void @glTexSubImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @_ZN10GLTexImage9UnbindTexEv() local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11SiftMatchGL18SetFeautreLocationEiPKfi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3) unnamed_addr #1 align 2 {
  %5 = alloca float, align 4
  %6 = getelementptr inbounds i8, ptr %0, i64 392
  %7 = sext i32 %1 to i64
  %8 = getelementptr inbounds [2 x i32], ptr %6, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 1
  br i1 %10, label %72, label %11

11:                                               ; preds = %4
  %12 = getelementptr inbounds i8, ptr %0, i64 424
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = add nsw i32 %9, -1
  %15 = add i32 %14, %13
  %16 = sdiv i32 %15, %13
  %17 = getelementptr inbounds i8, ptr %0, i64 440
  %18 = shl nuw nsw i32 %9, 1
  %19 = zext nneg i32 %18 to i64
  tail call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %19)
  %20 = icmp eq i32 %3, 0
  br i1 %20, label %24, label %.preheader40

.preheader40:                                     ; preds = %11
  %21 = load i32, ptr %8, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph, label %.loopexit41

.lr.ph:                                           ; preds = %.preheader40
  %23 = sext i32 %3 to i64
  br label %30

24:                                               ; preds = %11
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef 0) #5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = shl nsw i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = shl nsw i64 %28, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %25, ptr align 4 %2, i64 %29, i1 false)
  br label %.loopexit41

30:                                               ; preds = %.lr.ph, %30
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %30 ]
  %.043 = phi ptr [ %2, %.lr.ph ], [ %39, %30 ]
  %31 = getelementptr inbounds i8, ptr %.043, i64 4
  %32 = load float, ptr %.043, align 4, !tbaa !18
  %33 = shl nuw nsw i64 %indvars.iv, 1
  %34 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %33) #5
  store float %32, ptr %34, align 4, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %.043, i64 8
  %36 = load float, ptr %31, align 4, !tbaa !18
  %37 = or disjoint i64 %33, 1
  %38 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %37) #5
  store float %36, ptr %38, align 4, !tbaa !18
  %39 = getelementptr inbounds float, ptr %35, i64 %23
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %8, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %30, label %.loopexit41, !llvm.loop !20

.loopexit41:                                      ; preds = %30, %.preheader40, %24
  %43 = shl i32 %13, 1
  %44 = mul i32 %43, %16
  %45 = sext i32 %44 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store float 0.000000e+00, ptr %5, align 4, !tbaa !18
  call void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %45, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  %46 = getelementptr inbounds i8, ptr %0, i64 32
  %47 = getelementptr inbounds [2 x %class.GLTexImage], ptr %46, i64 0, i64 %7
  %48 = load ptr, ptr %47, align 8, !tbaa !22
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = load ptr, ptr %49, align 8
  call void %50(ptr noundef nonnull align 8 dereferenceable(36) %47, i32 noundef %13, i32 noundef %16)
  call void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %47)
  %51 = getelementptr inbounds i8, ptr %0, i64 420
  %52 = load i32, ptr %51, align 4, !tbaa !24
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %57, label %.preheader

.preheader:                                       ; preds = %.loopexit41
  %54 = icmp sgt i32 %52, 0
  br i1 %54, label %.lr.ph45, label %.loopexit

.lr.ph45:                                         ; preds = %.preheader
  %55 = getelementptr inbounds i8, ptr %0, i64 416
  %56 = shl i32 %16, 1
  br label %60

57:                                               ; preds = %.loopexit41
  %58 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef 0) #5
  call void @glTexSubImage2D(i32 noundef %58, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %13, i32 noundef %16, i32 noundef 6410, i32 noundef 5126, ptr noundef nonnull %59)
  br label %.loopexit

60:                                               ; preds = %.lr.ph45, %60
  %.03744 = phi i32 [ 0, %.lr.ph45 ], [ %67, %60 ]
  %61 = load i32, ptr %55, align 8, !tbaa !25
  %62 = mul nsw i32 %61, %.03744
  %63 = mul i32 %56, %62
  %64 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %65) #5
  call void @glTexSubImage2D(i32 noundef %64, i32 noundef 0, i32 noundef %62, i32 noundef 0, i32 noundef %61, i32 noundef %16, i32 noundef 6410, i32 noundef 5126, ptr noundef nonnull %66)
  %67 = add nuw nsw i32 %.03744, 1
  %68 = load i32, ptr %51, align 4, !tbaa !24
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %60, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %60, %.preheader, %57
  call void @_ZN10GLTexImage9UnbindTexEv()
  %70 = getelementptr inbounds i8, ptr %0, i64 408
  %71 = getelementptr inbounds [2 x i32], ptr %70, i64 0, i64 %7
  store i32 1, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %4, %.loopexit
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress 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 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 424}
!10 = !{!"_ZTS11SiftMatchGL", !11, i64 0, !7, i64 32, !7, i64 112, !13, i64 192, !7, i64 232, !12, i64 312, !12, i64 320, !12, i64 328, !12, i64 336, !6, i64 344, !6, i64 348, !6, i64 352, !6, i64 356, !6, i64 360, !6, i64 364, !6, i64 368, !6, i64 372, !6, i64 376, !6, i64 380, !6, i64 384, !6, i64 388, !7, i64 392, !7, i64 400, !7, i64 408, !6, i64 416, !6, i64 420, !6, i64 424, !6, i64 428, !6, i64 432, !14, i64 440}
!11 = !{!"_ZTS12SiftMatchGPU", !6, i64 8, !6, i64 12, !12, i64 16, !6, i64 24}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"_ZTS10GLTexImage", !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32}
!14 = !{!"_ZTSSt6vectorIfSaIfEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!18 = !{!19, !19, i64 0}
!19 = !{!"float", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !8, i64 0}
!24 = !{!10, !6, i64 420}
!25 = !{!10, !6, i64 416}
!26 = distinct !{!26, !21}


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