; LLVM IR from rdguez-mariano/fast_imas_IPOL :: libLocalDesc/surf/lib_match_surf.ll (Z15matchDescriptorPSt6vectorIP10descriptorSaIS1_EES4_)

; 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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl" }
%"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl" = type { %"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.MatchSurf = type { float, float, float, float, float, float, float, float }
%class.descriptor = type { ptr, ptr }
%class.keyPoint = type <{ double, double, double, double, i8, [7 x i8] }>

@surf_ratio = external dso_local global float, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15matchDescriptorPSt6vectorIP10descriptorSaIS1_EES4_(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.MatchSurf, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorI9MatchSurfSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %199, %3
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20) #3
  %22 = trunc i64 %21 to i32
  %23 = icmp slt i32 %19, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %18
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %203

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 -1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store float 3.000000e+00, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store float 3.000000e+00, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %92, %25
  %27 = load i32, ptr %13, align 4, !tbaa !9
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #3
  %30 = trunc i64 %29 to i32
  %31 = icmp slt i32 %27, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %26
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %95

33:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %36) #3
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = load i32, ptr %13, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %41) #3
  %43 = load ptr, ptr %42, align 8, !tbaa !5
  %44 = invoke noundef float @_Z17euclideanDistanceP10descriptorS0_(ptr noundef %38, ptr noundef %43)
          to label %45 unwind label %86

45:                                               ; preds = %33
  store float %44, ptr %14, align 4, !tbaa !11
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %48) #3
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = getelementptr inbounds %class.descriptor, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %class.keyPoint, ptr %52, i32 0, i32 4
  %54 = load i8, ptr %53, align 8, !tbaa !15, !range !19, !noundef !20
  %55 = trunc i8 %54 to i1
  %56 = zext i1 %55 to i32
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #3
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = getelementptr inbounds %class.descriptor, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !13
  %64 = getelementptr inbounds %class.keyPoint, ptr %63, i32 0, i32 4
  %65 = load i8, ptr %64, align 8, !tbaa !15, !range !19, !noundef !20
  %66 = trunc i8 %65 to i1
  %67 = zext i1 %66 to i32
  %68 = icmp eq i32 %56, %67
  br i1 %68, label %69, label %91

69:                                               ; preds = %45
  %70 = load float, ptr %12, align 4, !tbaa !11
  %71 = load float, ptr %14, align 4, !tbaa !11
  %72 = fcmp ogt float %70, %71
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = load float, ptr %14, align 4, !tbaa !11
  br label %77

75:                                               ; preds = %69
  %76 = load float, ptr %12, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %75, %73
  %78 = phi float [ %74, %73 ], [ %76, %75 ]
  store float %78, ptr %12, align 4, !tbaa !11
  %79 = load float, ptr %11, align 4, !tbaa !11
  %80 = load float, ptr %14, align 4, !tbaa !11
  %81 = fcmp ogt float %79, %80
  br i1 %81, label %82, label %90

82:                                               ; preds = %77
  %83 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %83, ptr %10, align 4, !tbaa !9
  %84 = load float, ptr %11, align 4, !tbaa !11
  store float %84, ptr %12, align 4, !tbaa !11
  %85 = load float, ptr %14, align 4, !tbaa !11
  store float %85, ptr %11, align 4, !tbaa !11
  br label %90

86:                                               ; preds = %33
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %15, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %202

90:                                               ; preds = %82, %77
  br label %91

91:                                               ; preds = %90, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %13, align 4, !tbaa !9
  br label %26, !llvm.loop !21

95:                                               ; preds = %32
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = icmp sge i32 %96, 0
  br i1 %97, label %98, label %198

98:                                               ; preds = %95
  %99 = load float, ptr @surf_ratio, align 4, !tbaa !11
  %100 = load float, ptr %12, align 4, !tbaa !11
  %101 = fmul float %99, %100
  %102 = load float, ptr %11, align 4, !tbaa !11
  %103 = fcmp ogt float %101, %102
  br i1 %103, label %104, label %198

104:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #3
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %105, i64 noundef %107) #3
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.descriptor, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds %class.keyPoint, ptr %111, i32 0, i32 0
  %113 = load double, ptr %112, align 8, !tbaa !23
  %114 = fptrunc double %113 to float
  %115 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 0
  store float %114, ptr %115, align 4, !tbaa !24
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %116, i64 noundef %118) #3
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = getelementptr inbounds %class.descriptor, ptr %120, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  %123 = getelementptr inbounds %class.keyPoint, ptr %122, i32 0, i32 1
  %124 = load double, ptr %123, align 8, !tbaa !26
  %125 = fptrunc double %124 to float
  %126 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 1
  store float %125, ptr %126, align 4, !tbaa !27
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %129) #3
  %131 = load ptr, ptr %130, align 8, !tbaa !5
  %132 = getelementptr inbounds %class.descriptor, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !13
  %134 = getelementptr inbounds %class.keyPoint, ptr %133, i32 0, i32 2
  %135 = load double, ptr %134, align 8, !tbaa !28
  %136 = fptrunc double %135 to float
  %137 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 2
  store float %136, ptr %137, align 4, !tbaa !29
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %138, i64 noundef %140) #3
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = getelementptr inbounds %class.descriptor, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !13
  %145 = getelementptr inbounds %class.keyPoint, ptr %144, i32 0, i32 3
  %146 = load double, ptr %145, align 8, !tbaa !30
  %147 = fptrunc double %146 to float
  %148 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 3
  store float %147, ptr %148, align 4, !tbaa !31
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %149, i64 noundef %151) #3
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  %154 = getelementptr inbounds %class.descriptor, ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !13
  %156 = getelementptr inbounds %class.keyPoint, ptr %155, i32 0, i32 0
  %157 = load double, ptr %156, align 8, !tbaa !23
  %158 = fptrunc double %157 to float
  %159 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 4
  store float %158, ptr %159, align 4, !tbaa !32
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = load i32, ptr %10, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef %162) #3
  %164 = load ptr, ptr %163, align 8, !tbaa !5
  %165 = getelementptr inbounds %class.descriptor, ptr %164, i32 0, i32 1
  %166 = load ptr, ptr %165, align 8, !tbaa !13
  %167 = getelementptr inbounds %class.keyPoint, ptr %166, i32 0, i32 1
  %168 = load double, ptr %167, align 8, !tbaa !26
  %169 = fptrunc double %168 to float
  %170 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 5
  store float %169, ptr %170, align 4, !tbaa !33
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = load i32, ptr %10, align 4, !tbaa !9
  %173 = sext i32 %172 to i64
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %171, i64 noundef %173) #3
  %175 = load ptr, ptr %174, align 8, !tbaa !5
  %176 = getelementptr inbounds %class.descriptor, ptr %175, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !13
  %178 = getelementptr inbounds %class.keyPoint, ptr %177, i32 0, i32 2
  %179 = load double, ptr %178, align 8, !tbaa !28
  %180 = fptrunc double %179 to float
  %181 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 6
  store float %180, ptr %181, align 4, !tbaa !34
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load i32, ptr %10, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %182, i64 noundef %184) #3
  %186 = load ptr, ptr %185, align 8, !tbaa !5
  %187 = getelementptr inbounds %class.descriptor, ptr %186, i32 0, i32 1
  %188 = load ptr, ptr %187, align 8, !tbaa !13
  %189 = getelementptr inbounds %class.keyPoint, ptr %188, i32 0, i32 3
  %190 = load double, ptr %189, align 8, !tbaa !30
  %191 = fptrunc double %190 to float
  %192 = getelementptr inbounds %struct.MatchSurf, ptr %17, i32 0, i32 7
  store float %191, ptr %192, align 4, !tbaa !35
  invoke void @_ZNSt6vectorI9MatchSurfSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(32) %17)
          to label %193 unwind label %194

193:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #3
  br label %198

194:                                              ; preds = %104
  %195 = landingpad { ptr, i32 }
          cleanup
  %196 = extractvalue { ptr, i32 } %195, 0
  store ptr %196, ptr %15, align 8
  %197 = extractvalue { ptr, i32 } %195, 1
  store i32 %197, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #3
  br label %202

198:                                              ; preds = %193, %98, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %199

199:                                              ; preds = %198
  %200 = load i32, ptr %8, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %8, align 4, !tbaa !9
  br label %18, !llvm.loop !36

202:                                              ; preds = %194, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @_ZNSt6vectorI9MatchSurfSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %207

203:                                              ; preds = %24
  store i1 true, ptr %7, align 1
  store i32 1, ptr %9, align 4
  %204 = load i1, ptr %7, align 1
  br i1 %204, label %206, label %205

205:                                              ; preds = %203
  call void @_ZNSt6vectorI9MatchSurfSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %206

206:                                              ; preds = %205, %203
  ret void

207:                                              ; preds = %202
  %208 = load ptr, ptr %15, align 8
  %209 = load i32, ptr %16, align 4
  %210 = insertvalue { ptr, i32 } poison, ptr %208, 0
  %211 = insertvalue { ptr, i32 } %210, i32 %209, 1
  resume { ptr, i32 } %211
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z17euclideanDistanceP10descriptorS0_(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(32)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !6, i64 8}
!14 = !{!"_ZTS10descriptor", !6, i64 0, !6, i64 8}
!15 = !{!16, !18, i64 32}
!16 = !{!"_ZTS8keyPoint", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !18, i64 32}
!17 = !{!"double", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!16, !17, i64 0}
!24 = !{!25, !12, i64 0}
!25 = !{!"_ZTS9MatchSurf", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!26 = !{!16, !17, i64 8}
!27 = !{!25, !12, i64 4}
!28 = !{!16, !17, i64 16}
!29 = !{!25, !12, i64 8}
!30 = !{!16, !17, i64 24}
!31 = !{!25, !12, i64 12}
!32 = !{!25, !12, i64 16}
!33 = !{!25, !12, i64 20}
!34 = !{!25, !12, i64 24}
!35 = !{!25, !12, i64 28}
!36 = distinct !{!36, !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.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl" }
%"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl" = type { %"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl_data" }
%"struct.std::_Vector_base<MatchSurf, std::allocator<MatchSurf>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.MatchSurf = type { float, float, float, float, float, float, float, float }

@surf_ratio = external dso_local local_unnamed_addr global float, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z15matchDescriptorPSt6vectorIP10descriptorSaIS1_EES4_(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.MatchSurf, align 4
  tail call void @_ZNSt6vectorI9MatchSurfSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  %5 = tail call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %6 = trunc i64 %5 to i32
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.preheader.lr.ph, label %._crit_edge58

.preheader.lr.ph:                                 ; preds = %3
  %8 = getelementptr inbounds i8, ptr %4, i64 4
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  %10 = getelementptr inbounds i8, ptr %4, i64 12
  %11 = getelementptr inbounds i8, ptr %4, i64 16
  %12 = getelementptr inbounds i8, ptr %4, i64 20
  %13 = getelementptr inbounds i8, ptr %4, i64 24
  %14 = getelementptr inbounds i8, ptr %4, i64 28
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge.thread
  %indvars.iv60 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next61, %._crit_edge.thread ]
  %15 = call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %16 = trunc i64 %15 to i32
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge.thread

._crit_edge:                                      ; preds = %43
  %18 = icmp sgt i32 %.149, -1
  br i1 %18, label %47, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.preheader, %43
  %indvars.iv = phi i64 [ %indvars.iv.next, %43 ], [ 0, %.preheader ]
  %.04553 = phi float [ %.1, %43 ], [ 3.000000e+00, %.preheader ]
  %.04652 = phi float [ %.147, %43 ], [ 3.000000e+00, %.preheader ]
  %.04851 = phi i32 [ %.149, %43 ], [ -1, %.preheader ]
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = call noundef float @_Z17euclideanDistanceP10descriptorS0_(ptr noundef %20, ptr noundef %22)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 32
  %29 = load i8, ptr %28, align 8, !tbaa !11, !range !15, !noundef !16
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #3
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %33, i64 32
  %35 = load i8, ptr %34, align 8, !tbaa !11, !range !15, !noundef !16
  %36 = icmp eq i8 %29, %35
  br i1 %36, label %37, label %43

37:                                               ; preds = %.lr.ph
  %38 = fcmp ogt float %.04553, %23
  %39 = select i1 %38, float %23, float %.04553
  %40 = fcmp ogt float %.04652, %23
  br i1 %40, label %41, label %43

41:                                               ; preds = %37
  %42 = trunc nuw nsw i64 %indvars.iv to i32
  br label %43

43:                                               ; preds = %37, %41, %.lr.ph
  %.149 = phi i32 [ %42, %41 ], [ %.04851, %37 ], [ %.04851, %.lr.ph ]
  %.147 = phi float [ %23, %41 ], [ %.04652, %37 ], [ %.04652, %.lr.ph ]
  %.1 = phi float [ %.04652, %41 ], [ %39, %37 ], [ %.04553, %.lr.ph ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #3
  %sext = shl i64 %44, 32
  %45 = ashr exact i64 %sext, 32
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph, label %._crit_edge, !llvm.loop !17

47:                                               ; preds = %._crit_edge
  %48 = load float, ptr @surf_ratio, align 4, !tbaa !19
  %49 = fmul float %.1, %48
  %50 = fcmp ogt float %49, %.147
  br i1 %50, label %51, label %._crit_edge.thread

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #3
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 8
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = load double, ptr %55, align 8, !tbaa !21
  %57 = fptrunc double %56 to float
  store float %57, ptr %4, align 4, !tbaa !22
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load double, ptr %62, align 8, !tbaa !24
  %64 = fptrunc double %63 to float
  store float %64, ptr %8, align 4, !tbaa !25
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  %70 = load double, ptr %69, align 8, !tbaa !26
  %71 = fptrunc double %70 to float
  store float %71, ptr %9, align 4, !tbaa !27
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv60) #3
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 8
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 24
  %77 = load double, ptr %76, align 8, !tbaa !28
  %78 = fptrunc double %77 to float
  store float %78, ptr %10, align 4, !tbaa !29
  %79 = zext nneg i32 %.149 to i64
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %79) #3
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i64 8
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = load double, ptr %83, align 8, !tbaa !21
  %85 = fptrunc double %84 to float
  store float %85, ptr %11, align 4, !tbaa !30
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %79) #3
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load double, ptr %90, align 8, !tbaa !24
  %92 = fptrunc double %91 to float
  store float %92, ptr %12, align 4, !tbaa !31
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %79) #3
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 8
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  %98 = load double, ptr %97, align 8, !tbaa !26
  %99 = fptrunc double %98 to float
  store float %99, ptr %13, align 4, !tbaa !32
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %79) #3
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = getelementptr inbounds i8, ptr %101, i64 8
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds i8, ptr %103, i64 24
  %105 = load double, ptr %104, align 8, !tbaa !28
  %106 = fptrunc double %105 to float
  store float %106, ptr %14, align 4, !tbaa !33
  invoke void @_ZNSt6vectorI9MatchSurfSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(32) %4)
          to label %107 unwind label %108

107:                                              ; preds = %51
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  br label %._crit_edge.thread

108:                                              ; preds = %51
  %109 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #3
  call void @_ZNSt6vectorI9MatchSurfSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  resume { ptr, i32 } %109

._crit_edge.thread:                               ; preds = %.preheader, %107, %47, %._crit_edge
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %110 = call noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #3
  %sext63 = shl i64 %110, 32
  %111 = ashr exact i64 %sext63, 32
  %112 = icmp slt i64 %indvars.iv.next61, %111
  br i1 %112, label %.preheader, label %._crit_edge58, !llvm.loop !34

._crit_edge58:                                    ; preds = %._crit_edge.thread, %3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIP10descriptorSaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z17euclideanDistanceP10descriptorS0_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP10descriptorSaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(32)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI9MatchSurfSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !6, i64 8}
!10 = !{!"_ZTS10descriptor", !6, i64 0, !6, i64 8}
!11 = !{!12, !14, i64 32}
!12 = !{!"_ZTS8keyPoint", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !14, i64 32}
!13 = !{!"double", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!12, !13, i64 0}
!22 = !{!23, !20, i64 0}
!23 = !{!"_ZTS9MatchSurf", !20, i64 0, !20, i64 4, !20, i64 8, !20, i64 12, !20, i64 16, !20, i64 20, !20, i64 24, !20, i64 28}
!24 = !{!12, !13, i64 8}
!25 = !{!23, !20, i64 4}
!26 = !{!12, !13, i64 16}
!27 = !{!23, !20, i64 8}
!28 = !{!12, !13, i64 24}
!29 = !{!23, !20, i64 12}
!30 = !{!23, !20, i64 16}
!31 = !{!23, !20, i64 20}
!32 = !{!23, !20, i64 24}
!33 = !{!23, !20, i64 28}
!34 = distinct !{!34, !18}


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