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

; 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 }
%class.SiftMatchGPU = type <{ ptr, i32, i32, ptr, i32, [4 x i8] }>

@_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
define dso_local void @_ZN11SiftMatchGL14SetDescriptorsEiiPKhi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) unnamed_addr #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  %18 = load ptr, ptr %6, align 8
  %19 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 29
  %20 = load i32, ptr %19, align 8, !tbaa !11
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %23

22:                                               ; preds = %5
  br label %157

23:                                               ; preds = %5
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp sgt i32 %24, 1
  br i1 %25, label %26, label %27

26:                                               ; preds = %23
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %26, %23
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %30, %27
  %32 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 24
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [2 x i32], ptr %32, i64 0, i64 %34
  store i32 0, ptr %35, align 4, !tbaa !9
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = icmp ne i32 %36, -1
  br i1 %37, label %38, label %47

38:                                               ; preds = %31
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 23
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [2 x i32], ptr %40, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = icmp eq i32 %39, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %38
  br label %157

47:                                               ; preds = %38, %31
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 23
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2 x i32], ptr %49, i64 0, i64 %51
  store i32 %48, ptr %52, align 4, !tbaa !9
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = getelementptr inbounds %class.SiftMatchGPU, ptr %18, i32 0, i32 4
  %55 = load i32, ptr %54, align 8, !tbaa !19
  %56 = icmp sgt i32 %53, %55
  br i1 %56, label %57, label %60

57:                                               ; preds = %47
  %58 = getelementptr inbounds %class.SiftMatchGPU, ptr %18, i32 0, i32 4
  %59 = load i32, ptr %58, align 8, !tbaa !19
  store i32 %59, ptr %8, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %57, %47
  %61 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 30
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = mul nsw i32 %62, 128
  %64 = sdiv i32 %63, 4
  %65 = sext i32 %64 to i64
  call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %61, i64 noundef %65)
  %66 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 30
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef 0) #5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load i32, ptr %8, align 4, !tbaa !9
  %70 = mul nsw i32 128, %69
  %71 = sext i32 %70 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %67, ptr align 1 %68, i64 %71, i1 false)
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 22
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2 x i32], ptr %73, i64 0, i64 %75
  store i32 %72, ptr %76, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %77 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 27
  %78 = load i32, ptr %77, align 8, !tbaa !20
  %79 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 28
  %80 = load i32, ptr %79, align 4, !tbaa !21
  %81 = mul nsw i32 %78, %80
  store i32 %81, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %82 = load i32, ptr %8, align 4, !tbaa !9
  %83 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 27
  %84 = load i32, ptr %83, align 8, !tbaa !20
  %85 = add nsw i32 %82, %84
  %86 = sub nsw i32 %85, 1
  %87 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 27
  %88 = load i32, ptr %87, align 8, !tbaa !20
  %89 = sdiv i32 %86, %88
  store i32 %89, ptr %12, align 4, !tbaa !9
  %90 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 30
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = load i32, ptr %12, align 4, !tbaa !9
  %93 = mul nsw i32 %91, %92
  %94 = mul nsw i32 %93, 4
  %95 = sext i32 %94 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store float 0.000000e+00, ptr %13, align 4, !tbaa !22
  call void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %95, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %96 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 3
  %97 = load i32, ptr %7, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [2 x %class.GLTexImage], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = load ptr, ptr %99, align 8, !tbaa !24
  %103 = getelementptr inbounds ptr, ptr %102, i64 5
  %104 = load ptr, ptr %103, align 8
  call void %104(ptr noundef nonnull align 8 dereferenceable(36) %99, i32 noundef %100, i32 noundef %101)
  %105 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 3
  %106 = load i32, ptr %7, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [2 x %class.GLTexImage], ptr %105, i64 0, i64 %107
  call void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %108)
  %109 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 26
  %110 = load i32, ptr %109, align 4, !tbaa !26
  %111 = icmp eq i32 %110, 1
  br i1 %111, label %112, label %118

112:                                              ; preds = %60
  %113 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !9
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 30
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %116, i64 noundef 0) #5
  call void @glTexSubImage2D(i32 noundef %113, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %114, i32 noundef %115, i32 noundef 6408, i32 noundef 5121, ptr noundef %117)
  br label %152

118:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %148, %118
  %120 = load i32, ptr %14, align 4, !tbaa !9
  %121 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 26
  %122 = load i32, ptr %121, align 4, !tbaa !26
  %123 = icmp slt i32 %120, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %151

125:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %126 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 25
  %127 = load i32, ptr %126, align 8, !tbaa !27
  %128 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 28
  %129 = load i32, ptr %128, align 4, !tbaa !21
  %130 = mul nsw i32 %127, %129
  store i32 %130, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %131 = load i32, ptr %14, align 4, !tbaa !9
  %132 = load i32, ptr %15, align 4, !tbaa !9
  %133 = mul nsw i32 %131, %132
  store i32 %133, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %134 = load i32, ptr %14, align 4, !tbaa !9
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = mul nsw i32 %134, %135
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = mul nsw i32 %136, %137
  %139 = mul nsw i32 %138, 4
  store i32 %139, ptr %17, align 4, !tbaa !9
  %140 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !9
  %141 = load i32, ptr %16, align 4, !tbaa !9
  %142 = load i32, ptr %15, align 4, !tbaa !9
  %143 = load i32, ptr %12, align 4, !tbaa !9
  %144 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 30
  %145 = load i32, ptr %17, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef %146) #5
  call void @glTexSubImage2D(i32 noundef %140, i32 noundef 0, i32 noundef %141, i32 noundef 0, i32 noundef %142, i32 noundef %143, i32 noundef 6408, i32 noundef 5121, ptr noundef %147)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %148

148:                                              ; preds = %125
  %149 = load i32, ptr %14, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %14, align 4, !tbaa !9
  br label %119, !llvm.loop !28

151:                                              ; preds = %124
  br label %152

152:                                              ; preds = %151, %112
  %153 = getelementptr inbounds %class.SiftMatchGL, ptr %18, i32 0, i32 3
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [2 x %class.GLTexImage], ptr %153, i64 0, i64 %155
  call void @_ZN10GLTexImage9UnbindTexEv()
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %157

157:                                              ; preds = %152, %46, %22
  ret void
}

; 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

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 432}
!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 = !{!13, !10, i64 24}
!20 = !{!12, !10, i64 424}
!21 = !{!12, !10, i64 428}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = !{!12, !10, i64 420}
!27 = !{!12, !10, i64 416}
!28 = distinct !{!28, !29}
!29 = !{!"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"

%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
define dso_local void @_ZN11SiftMatchGL14SetDescriptorsEiiPKhi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4) unnamed_addr #1 align 2 {
  %6 = alloca float, align 4
  %7 = getelementptr inbounds i8, ptr %0, i64 432
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %69, label %10

10:                                               ; preds = %5
  %11 = icmp sgt i32 %1, 0
  %12 = getelementptr inbounds i8, ptr %0, i64 408
  %13 = zext i1 %11 to i64
  %14 = getelementptr inbounds [2 x i32], ptr %12, i64 0, i64 %13
  store i32 0, ptr %14, align 4, !tbaa !17
  %.not = icmp eq i32 %4, -1
  br i1 %.not, label %20, label %15

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 400
  %17 = getelementptr inbounds [2 x i32], ptr %16, i64 0, i64 %13
  %18 = load i32, ptr %17, align 4, !tbaa !17
  %19 = icmp eq i32 %18, %4
  br i1 %19, label %69, label %20

20:                                               ; preds = %15, %10
  %21 = getelementptr inbounds i8, ptr %0, i64 400
  %22 = getelementptr inbounds [2 x i32], ptr %21, i64 0, i64 %13
  store i32 %4, ptr %22, align 4, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  %24 = load i32, ptr %23, align 8, !tbaa !18
  %spec.select = tail call i32 @llvm.smin.i32(i32 %24, i32 %2)
  %25 = getelementptr inbounds i8, ptr %0, i64 440
  %26 = shl nsw i32 %spec.select, 7
  %27 = shl nsw i32 %spec.select, 5
  %28 = sext i32 %27 to i64
  tail call void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %28)
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #6
  %30 = sext i32 %26 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %29, ptr align 1 %3, i64 %30, i1 false)
  %31 = getelementptr inbounds i8, ptr %0, i64 392
  %32 = getelementptr inbounds [2 x i32], ptr %31, i64 0, i64 %13
  store i32 %spec.select, ptr %32, align 4, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %0, i64 424
  %34 = load i32, ptr %33, align 8, !tbaa !19
  %35 = getelementptr inbounds i8, ptr %0, i64 428
  %36 = load i32, ptr %35, align 4, !tbaa !20
  %37 = mul nsw i32 %36, %34
  %38 = add i32 %spec.select, -1
  %39 = add i32 %38, %34
  %40 = sdiv i32 %39, %34
  %41 = shl i32 %40, 2
  %42 = mul i32 %41, %37
  %43 = sext i32 %42 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store float 0.000000e+00, ptr %6, align 4, !tbaa !21
  call void @_ZNSt6vectorIfSaIfEE6resizeEmRKf(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %43, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %44 = getelementptr inbounds i8, ptr %0, i64 112
  %45 = getelementptr inbounds [2 x %class.GLTexImage], ptr %44, i64 0, i64 %13
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %46, i64 40
  %48 = load ptr, ptr %47, align 8
  call void %48(ptr noundef nonnull align 8 dereferenceable(36) %45, i32 noundef %37, i32 noundef %40)
  call void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %45)
  %49 = getelementptr inbounds i8, ptr %0, i64 420
  %50 = load i32, ptr %49, align 4, !tbaa !25
  %51 = icmp eq i32 %50, 1
  br i1 %51, label %54, label %.preheader

.preheader:                                       ; preds = %20
  %52 = icmp sgt i32 %50, 0
  br i1 %52, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader
  %53 = getelementptr inbounds i8, ptr %0, i64 416
  br label %57

54:                                               ; preds = %20
  %55 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !17
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef 0) #6
  call void @glTexSubImage2D(i32 noundef %55, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %37, i32 noundef %40, i32 noundef 6408, i32 noundef 5121, ptr noundef nonnull %56)
  br label %.loopexit

57:                                               ; preds = %.lr.ph, %57
  %.03640 = phi i32 [ 0, %.lr.ph ], [ %66, %57 ]
  %58 = load i32, ptr %53, align 8, !tbaa !26
  %59 = load i32, ptr %35, align 4, !tbaa !20
  %60 = mul nsw i32 %59, %58
  %61 = mul nsw i32 %60, %.03640
  %62 = mul i32 %41, %61
  %63 = load i32, ptr @_ZN11GlobalParam10_texTargetE, align 4, !tbaa !17
  %64 = sext i32 %62 to i64
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %64) #6
  call void @glTexSubImage2D(i32 noundef %63, i32 noundef 0, i32 noundef %61, i32 noundef 0, i32 noundef %60, i32 noundef %40, i32 noundef 6408, i32 noundef 5121, ptr noundef nonnull %65)
  %66 = add nuw nsw i32 %.03640, 1
  %67 = load i32, ptr %49, align 4, !tbaa !25
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %57, label %.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %57, %.preheader, %54
  call void @_ZN10GLTexImage9UnbindTexEv()
  br label %69

69:                                               ; preds = %15, %5, %.loopexit
  ret void
}

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5

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


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