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

; 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.FrameBufferObject = type { i32 }
%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 }

@__glewActiveTexture = external global ptr, align 8
@__glewUniform1i = external global ptr, align 8
@__glewUniformMatrix3fv = external global ptr, align 8
@__glewUniform4fv = external global ptr, align 8

declare i32 @__gxx_personality_v0(...)

; 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11SiftMatchGL18GetGuidedSiftMatchEiPA2_jPfS2_ffffi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, i32 noundef %9) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %class.FrameBufferObject, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca [4 x float], align 16
  store ptr %0, ptr %12, align 8, !tbaa !5
  store i32 %1, ptr %13, align 4, !tbaa !9
  store ptr %2, ptr %14, align 8, !tbaa !5
  store ptr %3, ptr %15, align 8, !tbaa !5
  store ptr %4, ptr %16, align 8, !tbaa !5
  store float %5, ptr %17, align 4, !tbaa !11
  store float %6, ptr %18, align 4, !tbaa !11
  store float %7, ptr %19, align 4, !tbaa !11
  store float %8, ptr %20, align 4, !tbaa !11
  store i32 %9, ptr %21, align 4, !tbaa !9
  %29 = load ptr, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %30 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 22
  %31 = getelementptr inbounds [2 x i32], ptr %30, i64 0, i64 1
  %32 = load i32, ptr %31, align 4, !tbaa !9
  store i32 %32, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %33 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 22
  %34 = getelementptr inbounds [2 x i32], ptr %33, i64 0, i64 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  store i32 %35, ptr %23, align 4, !tbaa !9
  %36 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 29
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %10
  store i32 0, ptr %11, align 4
  store i32 1, ptr %24, align 4
  br label %160

40:                                               ; preds = %10
  %41 = load i32, ptr %22, align 4, !tbaa !9
  %42 = icmp sle i32 %41, 0
  br i1 %42, label %46, label %43

43:                                               ; preds = %40
  %44 = load i32, ptr %23, align 4, !tbaa !9
  %45 = icmp sle i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %43, %40
  store i32 0, ptr %11, align 4
  store i32 1, ptr %24, align 4
  br label %160

47:                                               ; preds = %43
  %48 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 24
  %49 = getelementptr inbounds [2 x i32], ptr %48, i64 0, i64 0
  %50 = load i32, ptr %49, align 8, !tbaa !9
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %57, label %52

52:                                               ; preds = %47
  %53 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 24
  %54 = getelementptr inbounds [2 x i32], ptr %53, i64 0, i64 1
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %52, %47
  store i32 0, ptr %11, align 4
  store i32 1, ptr %24, align 4
  br label %160

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  call void @_ZN17FrameBufferObjectC1Ei(ptr noundef nonnull align 4 dereferenceable(4) %25, i32 noundef 1)
  invoke void @glDrawBuffer(i32 noundef 36064)
          to label %59 unwind label %151

59:                                               ; preds = %58
  %60 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 4
  %61 = load i32, ptr %22, align 4, !tbaa !9
  %62 = load i32, ptr %23, align 4, !tbaa !9
  invoke void @_ZN10GLTexImage12SetImageSizeEii(ptr noundef nonnull align 8 dereferenceable(36) %60, i32 noundef %61, i32 noundef %62)
          to label %63 unwind label %151

63:                                               ; preds = %59
  %64 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 4
  invoke void @_ZN10GLTexImage11AttachToFBOEi(ptr noundef nonnull align 8 dereferenceable(36) %64, i32 noundef 0)
          to label %65 unwind label %151

65:                                               ; preds = %63
  %66 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 4
  invoke void @_ZN10GLTexImage14FitTexViewPortEv(ptr noundef nonnull align 8 dereferenceable(36) %66)
          to label %67 unwind label %151

67:                                               ; preds = %65
  %68 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  invoke void %68(i32 noundef 33984)
          to label %69 unwind label %151

69:                                               ; preds = %67
  %70 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 3
  %71 = getelementptr inbounds [2 x %class.GLTexImage], ptr %70, i64 0, i64 0
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %71)
          to label %72 unwind label %151

72:                                               ; preds = %69
  %73 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  invoke void %73(i32 noundef 33985)
          to label %74 unwind label %151

74:                                               ; preds = %72
  %75 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 3
  %76 = getelementptr inbounds [2 x %class.GLTexImage], ptr %75, i64 0, i64 1
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %76)
          to label %77 unwind label %151

77:                                               ; preds = %74
  %78 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  invoke void %78(i32 noundef 33986)
          to label %79 unwind label %151

79:                                               ; preds = %77
  %80 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 2
  %81 = getelementptr inbounds [2 x %class.GLTexImage], ptr %80, i64 0, i64 0
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %81)
          to label %82 unwind label %151

82:                                               ; preds = %79
  %83 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !5
  invoke void %83(i32 noundef 33987)
          to label %84 unwind label %151

84:                                               ; preds = %82
  %85 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 2
  %86 = getelementptr inbounds [2 x %class.GLTexImage], ptr %85, i64 0, i64 1
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %86)
          to label %87 unwind label %151

87:                                               ; preds = %84
  %88 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 7
  %89 = load ptr, ptr %88, align 8, !tbaa !21
  %90 = load ptr, ptr %89, align 8, !tbaa !22
  %91 = getelementptr inbounds ptr, ptr %90, i64 0
  %92 = load ptr, ptr %91, align 8
  %93 = invoke noundef i32 %92(ptr noundef nonnull align 8 dereferenceable(8) %89)
          to label %94 unwind label %151

94:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #5
  %95 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 3
  %96 = getelementptr inbounds [2 x %class.GLTexImage], ptr %95, i64 0, i64 0
  %97 = invoke noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %96)
          to label %98 unwind label %155

98:                                               ; preds = %94
  %99 = sitofp i32 %97 to float
  store float %99, ptr %28, align 4, !tbaa !11
  %100 = getelementptr inbounds float, ptr %28, i64 1
  %101 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 3
  %102 = getelementptr inbounds [2 x %class.GLTexImage], ptr %101, i64 0, i64 1
  %103 = invoke noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %102)
          to label %104 unwind label %155

104:                                              ; preds = %98
  %105 = sitofp i32 %103 to float
  store float %105, ptr %100, align 4, !tbaa !11
  %106 = getelementptr inbounds float, ptr %28, i64 2
  %107 = load float, ptr %19, align 4, !tbaa !11
  store float %107, ptr %106, align 4, !tbaa !11
  %108 = getelementptr inbounds float, ptr %28, i64 3
  %109 = load float, ptr %20, align 4, !tbaa !11
  store float %109, ptr %108, align 4, !tbaa !11
  %110 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !5
  %111 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 15
  %112 = load i32, ptr %111, align 4, !tbaa !24
  invoke void %110(i32 noundef %112, i32 noundef 0)
          to label %113 unwind label %155

113:                                              ; preds = %104
  %114 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !5
  %115 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 16
  %116 = load i32, ptr %115, align 8, !tbaa !25
  invoke void %114(i32 noundef %116, i32 noundef 1)
          to label %117 unwind label %155

117:                                              ; preds = %113
  %118 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !5
  %119 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 17
  %120 = load i32, ptr %119, align 4, !tbaa !26
  invoke void %118(i32 noundef %120, i32 noundef 2)
          to label %121 unwind label %155

121:                                              ; preds = %117
  %122 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !5
  %123 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 18
  %124 = load i32, ptr %123, align 8, !tbaa !27
  invoke void %122(i32 noundef %124, i32 noundef 3)
          to label %125 unwind label %155

125:                                              ; preds = %121
  %126 = load ptr, ptr @__glewUniformMatrix3fv, align 8, !tbaa !5
  %127 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 19
  %128 = load i32, ptr %127, align 4, !tbaa !28
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  invoke void %126(i32 noundef %128, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %129)
          to label %130 unwind label %155

130:                                              ; preds = %125
  %131 = load ptr, ptr @__glewUniformMatrix3fv, align 8, !tbaa !5
  %132 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 20
  %133 = load i32, ptr %132, align 8, !tbaa !29
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void %131(i32 noundef %133, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %134)
          to label %135 unwind label %155

135:                                              ; preds = %130
  %136 = load ptr, ptr @__glewUniform4fv, align 8, !tbaa !5
  %137 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 21
  %138 = load i32, ptr %137, align 4, !tbaa !30
  %139 = getelementptr inbounds [4 x float], ptr %28, i64 0, i64 0
  invoke void %136(i32 noundef %138, i32 noundef 1, ptr noundef %139)
          to label %140 unwind label %155

140:                                              ; preds = %135
  %141 = getelementptr inbounds %class.SiftMatchGL, ptr %29, i32 0, i32 4
  invoke void @_ZN10GLTexImage8DrawQuadEv(ptr noundef nonnull align 8 dereferenceable(36) %141)
          to label %142 unwind label %155

142:                                              ; preds = %140
  invoke void @_ZN10GLTexImage14UnbindMultiTexEi(i32 noundef 4)
          to label %143 unwind label %155

143:                                              ; preds = %142
  %144 = load i32, ptr %13, align 4, !tbaa !9
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = load float, ptr %17, align 4, !tbaa !11
  %147 = load float, ptr %18, align 4, !tbaa !11
  %148 = load i32, ptr %21, align 4, !tbaa !9
  %149 = invoke noundef i32 @_ZN11SiftMatchGL12GetBestMatchEiPA2_jffi(ptr noundef nonnull align 8 dereferenceable(464) %29, i32 noundef %144, ptr noundef %145, float noundef %146, float noundef %147, i32 noundef %148)
          to label %150 unwind label %155

150:                                              ; preds = %143
  store i32 %149, ptr %11, align 4
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  call void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %160

151:                                              ; preds = %87, %84, %82, %79, %77, %74, %72, %69, %67, %65, %63, %59, %58
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %26, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %27, align 4
  br label %159

155:                                              ; preds = %143, %142, %140, %135, %130, %125, %121, %117, %113, %104, %98, %94
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %26, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #5
  br label %159

159:                                              ; preds = %155, %151
  call void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %162

160:                                              ; preds = %150, %57, %46, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %161 = load i32, ptr %11, align 4
  ret i32 %161

162:                                              ; preds = %159
  %163 = load ptr, ptr %26, align 8
  %164 = load i32, ptr %27, align 4
  %165 = insertvalue { ptr, i32 } poison, ptr %163, 0
  %166 = insertvalue { ptr, i32 } %165, i32 %164, 1
  resume { ptr, i32 } %166
}

declare void @_ZN17FrameBufferObjectC1Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1

declare void @glDrawBuffer(i32 noundef) #1

declare void @_ZN10GLTexImage12SetImageSizeEii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef) unnamed_addr #1

declare void @_ZN10GLTexImage11AttachToFBOEi(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) #1

declare void @_ZN10GLTexImage14FitTexViewPortEv(ptr noundef nonnull align 8 dereferenceable(36)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

declare void @_ZN10GLTexImage8DrawQuadEv(ptr noundef nonnull align 8 dereferenceable(36)) #1

declare void @_ZN10GLTexImage14UnbindMultiTexEi(i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN11SiftMatchGL12GetBestMatchEiPA2_jffi(ptr noundef nonnull align 8 dereferenceable(464), i32 noundef, ptr noundef, float noundef, float noundef, i32 noundef) #2 align 2

; Function Attrs: nounwind
declare void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 #3 = { 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 #4 = { 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 #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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 432}
!14 = !{!"_ZTS11SiftMatchGL", !15, i64 0, !7, i64 32, !7, i64 112, !16, 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, !17, i64 440}
!15 = !{!"_ZTS12SiftMatchGPU", !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!16 = !{!"_ZTS10GLTexImage", !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!17 = !{!"_ZTSSt6vectorIfSaIfEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIfSaIfEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIfSaIfEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!14, !6, i64 320}
!22 = !{!23, !23, i64 0}
!23 = !{!"vtable pointer", !8, i64 0}
!24 = !{!14, !10, i64 364}
!25 = !{!14, !10, i64 368}
!26 = !{!14, !10, i64 372}
!27 = !{!14, !10, i64 376}
!28 = !{!14, !10, i64 380}
!29 = !{!14, !10, i64 384}
!30 = !{!14, !10, i64 388}


; 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.FrameBufferObject = type { i32 }

@__glewActiveTexture = external local_unnamed_addr global ptr, align 8
@__glewUniform1i = external local_unnamed_addr global ptr, align 8
@__glewUniformMatrix3fv = external local_unnamed_addr global ptr, align 8
@__glewUniform4fv = external local_unnamed_addr global ptr, align 8

declare i32 @__gxx_personality_v0(...)

; 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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11SiftMatchGL18GetGuidedSiftMatchEiPA2_jPfS2_ffffi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, float noundef %5, float noundef %6, float noundef %7, float noundef %8, i32 noundef %9) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %11 = alloca %class.FrameBufferObject, align 4
  %12 = alloca [4 x float], align 16
  %13 = getelementptr inbounds i8, ptr %0, i64 392
  %14 = getelementptr inbounds i8, ptr %0, i64 396
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = load i32, ptr %13, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 432
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %102, label %20

20:                                               ; preds = %10
  %21 = icmp slt i32 %15, 1
  %22 = icmp slt i32 %16, 1
  %or.cond = select i1 %21, i1 true, i1 %22
  br i1 %or.cond, label %102, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 408
  %25 = load i32, ptr %24, align 8, !tbaa !5
  %26 = icmp eq i32 %25, 0
  %27 = getelementptr inbounds i8, ptr %0, i64 412
  %28 = load i32, ptr %27, align 4
  %29 = icmp eq i32 %28, 0
  %or.cond24 = select i1 %26, i1 true, i1 %29
  br i1 %or.cond24, label %102, label %30

30:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  call void @_ZN17FrameBufferObjectC1Ei(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 1)
  invoke void @glDrawBuffer(i32 noundef 36064)
          to label %31 unwind label %97

31:                                               ; preds = %30
  %32 = getelementptr inbounds i8, ptr %0, i64 192
  invoke void @_ZN10GLTexImage12SetImageSizeEii(ptr noundef nonnull align 8 dereferenceable(36) %32, i32 noundef %15, i32 noundef %16)
          to label %33 unwind label %97

33:                                               ; preds = %31
  invoke void @_ZN10GLTexImage11AttachToFBOEi(ptr noundef nonnull align 8 dereferenceable(36) %32, i32 noundef 0)
          to label %34 unwind label %97

34:                                               ; preds = %33
  invoke void @_ZN10GLTexImage14FitTexViewPortEv(ptr noundef nonnull align 8 dereferenceable(36) %32)
          to label %35 unwind label %97

35:                                               ; preds = %34
  %36 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !18
  invoke void %36(i32 noundef 33984)
          to label %37 unwind label %97

37:                                               ; preds = %35
  %38 = getelementptr inbounds i8, ptr %0, i64 112
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %38)
          to label %39 unwind label %97

39:                                               ; preds = %37
  %40 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !18
  invoke void %40(i32 noundef 33985)
          to label %41 unwind label %97

41:                                               ; preds = %39
  %42 = getelementptr inbounds i8, ptr %0, i64 152
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %42)
          to label %43 unwind label %97

43:                                               ; preds = %41
  %44 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !18
  invoke void %44(i32 noundef 33986)
          to label %45 unwind label %97

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %0, i64 32
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %46)
          to label %47 unwind label %97

47:                                               ; preds = %45
  %48 = load ptr, ptr @__glewActiveTexture, align 8, !tbaa !18
  invoke void %48(i32 noundef 33987)
          to label %49 unwind label %97

49:                                               ; preds = %47
  %50 = getelementptr inbounds i8, ptr %0, i64 72
  invoke void @_ZN10GLTexImage7BindTexEv(ptr noundef nonnull align 8 dereferenceable(36) %50)
          to label %51 unwind label %97

51:                                               ; preds = %49
  %52 = getelementptr inbounds i8, ptr %0, i64 320
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = load ptr, ptr %53, align 8, !tbaa !20
  %55 = load ptr, ptr %54, align 8
  %56 = invoke noundef i32 %55(ptr noundef nonnull align 8 dereferenceable(8) %53)
          to label %57 unwind label %97

57:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %58 = call noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %38)
  %59 = sitofp i32 %58 to float
  store float %59, ptr %12, align 16, !tbaa !22
  %60 = getelementptr inbounds i8, ptr %12, i64 4
  %61 = call noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %42)
  %62 = sitofp i32 %61 to float
  store float %62, ptr %60, align 4, !tbaa !22
  %63 = getelementptr inbounds i8, ptr %12, i64 8
  store float %7, ptr %63, align 8, !tbaa !22
  %64 = getelementptr inbounds i8, ptr %12, i64 12
  store float %8, ptr %64, align 4, !tbaa !22
  %65 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !18
  %66 = getelementptr inbounds i8, ptr %0, i64 364
  %67 = load i32, ptr %66, align 4, !tbaa !24
  invoke void %65(i32 noundef %67, i32 noundef 0)
          to label %68 unwind label %99

68:                                               ; preds = %57
  %69 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !18
  %70 = getelementptr inbounds i8, ptr %0, i64 368
  %71 = load i32, ptr %70, align 8, !tbaa !25
  invoke void %69(i32 noundef %71, i32 noundef 1)
          to label %72 unwind label %99

72:                                               ; preds = %68
  %73 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !18
  %74 = getelementptr inbounds i8, ptr %0, i64 372
  %75 = load i32, ptr %74, align 4, !tbaa !26
  invoke void %73(i32 noundef %75, i32 noundef 2)
          to label %76 unwind label %99

76:                                               ; preds = %72
  %77 = load ptr, ptr @__glewUniform1i, align 8, !tbaa !18
  %78 = getelementptr inbounds i8, ptr %0, i64 376
  %79 = load i32, ptr %78, align 8, !tbaa !27
  invoke void %77(i32 noundef %79, i32 noundef 3)
          to label %80 unwind label %99

80:                                               ; preds = %76
  %81 = load ptr, ptr @__glewUniformMatrix3fv, align 8, !tbaa !18
  %82 = getelementptr inbounds i8, ptr %0, i64 380
  %83 = load i32, ptr %82, align 4, !tbaa !28
  invoke void %81(i32 noundef %83, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %3)
          to label %84 unwind label %99

84:                                               ; preds = %80
  %85 = load ptr, ptr @__glewUniformMatrix3fv, align 8, !tbaa !18
  %86 = getelementptr inbounds i8, ptr %0, i64 384
  %87 = load i32, ptr %86, align 8, !tbaa !29
  invoke void %85(i32 noundef %87, i32 noundef 1, i8 noundef zeroext 1, ptr noundef %4)
          to label %88 unwind label %99

88:                                               ; preds = %84
  %89 = load ptr, ptr @__glewUniform4fv, align 8, !tbaa !18
  %90 = getelementptr inbounds i8, ptr %0, i64 388
  %91 = load i32, ptr %90, align 4, !tbaa !30
  invoke void %89(i32 noundef %91, i32 noundef 1, ptr noundef nonnull %12)
          to label %92 unwind label %99

92:                                               ; preds = %88
  invoke void @_ZN10GLTexImage8DrawQuadEv(ptr noundef nonnull align 8 dereferenceable(36) %32)
          to label %93 unwind label %99

93:                                               ; preds = %92
  invoke void @_ZN10GLTexImage14UnbindMultiTexEi(i32 noundef 4)
          to label %94 unwind label %99

94:                                               ; preds = %93
  %95 = invoke noundef i32 @_ZN11SiftMatchGL12GetBestMatchEiPA2_jffi(ptr noundef nonnull align 8 dereferenceable(464) %0, i32 noundef %1, ptr noundef %2, float noundef %5, float noundef %6, i32 noundef %9)
          to label %96 unwind label %99

96:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %102

97:                                               ; preds = %51, %49, %47, %45, %43, %41, %39, %37, %35, %34, %33, %31, %30
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %101

99:                                               ; preds = %94, %93, %92, %88, %84, %80, %76, %72, %68, %57
  %100 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  br label %101

101:                                              ; preds = %99, %97
  %.pn = phi { ptr, i32 } [ %100, %99 ], [ %98, %97 ]
  call void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4) %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  resume { ptr, i32 } %.pn

102:                                              ; preds = %23, %20, %10, %96
  %.018 = phi i32 [ %95, %96 ], [ 0, %10 ], [ 0, %20 ], [ 0, %23 ]
  ret i32 %.018
}

declare void @_ZN17FrameBufferObjectC1Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #1

declare void @glDrawBuffer(i32 noundef) local_unnamed_addr #1

declare void @_ZN10GLTexImage12SetImageSizeEii(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef, i32 noundef) unnamed_addr #1

declare void @_ZN10GLTexImage11AttachToFBOEi(ptr noundef nonnull align 8 dereferenceable(36), i32 noundef) local_unnamed_addr #1

declare void @_ZN10GLTexImage14FitTexViewPortEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN10GLTexImage13GetDrawHeightEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

declare void @_ZN10GLTexImage8DrawQuadEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #1

declare void @_ZN10GLTexImage14UnbindMultiTexEi(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN11SiftMatchGL12GetBestMatchEiPA2_jffi(ptr noundef nonnull align 8 dereferenceable(464), i32 noundef, ptr noundef, float noundef, float noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN17FrameBufferObjectD1Ev(ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 #3 = { 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 #4 = { 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 #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 432}
!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 = !{!12, !12, i64 0}
!19 = !{!10, !12, i64 320}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"float", !7, i64 0}
!24 = !{!10, !6, i64 364}
!25 = !{!10, !6, i64 368}
!26 = !{!10, !6, i64 372}
!27 = !{!10, !6, i64 376}
!28 = !{!10, !6, i64 380}
!29 = !{!10, !6, i64 384}
!30 = !{!10, !6, i64 388}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass