; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseDetection.ll (ZN4Simd4Base9Detect32fERKNS_9Detection14HidHaarCascadeEmif)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Simd::Detection::HidHaarCascade" = type { %"struct.Simd::Detection::HidBase", %"class.std::vector.41", %"class.std::vector.46", %"class.std::vector.51", %"class.std::vector.14", %"class.std::vector.56", float, float, [4 x ptr], [4 x ptr], %"struct.Simd::View", %"struct.Simd::View", %"struct.Simd::View", %"struct.Simd::View", %"struct.Simd::View" }
%"struct.Simd::Detection::HidBase" = type { %"struct.Simd::Deletable", i32, %"struct.Simd::Point", i8, i8, i8, i8, i32 }
%"struct.Simd::Deletable" = type { ptr }
%"struct.Simd::Point" = type { i64, i64 }
%"class.std::vector.41" = type { %"struct.std::_Vector_base.42" }
%"struct.std::_Vector_base.42" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarNode, std::allocator<Simd::Detection::HidHaarNode>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarNode, std::allocator<Simd::Detection::HidHaarNode>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarNode, std::allocator<Simd::Detection::HidHaarNode>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarNode, std::allocator<Simd::Detection::HidHaarNode>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.46" = type { %"struct.std::_Vector_base.47" }
%"struct.std::_Vector_base.47" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarCascade::Tree, std::allocator<Simd::Detection::HidHaarCascade::Tree>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarCascade::Tree, std::allocator<Simd::Detection::HidHaarCascade::Tree>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarCascade::Tree, std::allocator<Simd::Detection::HidHaarCascade::Tree>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarCascade::Tree, std::allocator<Simd::Detection::HidHaarCascade::Tree>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.51" = type { %"struct.std::_Vector_base.52" }
%"struct.std::_Vector_base.52" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarStage, std::allocator<Simd::Detection::HidHaarStage>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarStage, std::allocator<Simd::Detection::HidHaarStage>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarStage, std::allocator<Simd::Detection::HidHaarStage>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarStage, std::allocator<Simd::Detection::HidHaarStage>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.14" = type { %"struct.std::_Vector_base.15" }
%"struct.std::_Vector_base.15" = 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.std::vector.56" = type { %"struct.std::_Vector_base.57" }
%"struct.std::_Vector_base.57" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarFeature, std::allocator<Simd::Detection::HidHaarFeature>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarFeature, std::allocator<Simd::Detection::HidHaarFeature>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Detection::HidHaarFeature, std::allocator<Simd::Detection::HidHaarFeature>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Detection::HidHaarFeature, std::allocator<Simd::Detection::HidHaarFeature>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"struct.Simd::Detection::HidHaarStage" = type { i32, i32, float, i8, i8 }
%"struct.Simd::Detection::HidHaarNode" = type { i32, i32, i32, float }
%"struct.Simd::Detection::HidHaarFeature" = type { [3 x %"struct.Simd::Detection::WeightedRect"] }
%"struct.Simd::Detection::WeightedRect" = type { ptr, ptr, ptr, ptr, float }

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4Simd4Base9Detect32fERKNS_9Detection14HidHaarCascadeEmif(ptr noundef nonnull align 8 dereferenceable(472) %0, i64 noundef %1, i32 noundef %2, float noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca float, align 4
  %19 = alloca ptr, align 8
  %20 = alloca float, align 4
  %21 = alloca ptr, align 8
  %22 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i64 %1, ptr %7, align 8, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !11
  store float %3, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %23, i32 0, i32 3
  %25 = call noundef ptr @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #4
  store ptr %25, ptr %10, align 8, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !11
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %27, i32 0, i32 3
  %29 = call noundef i64 @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #4
  %30 = trunc i64 %29 to i32
  %31 = icmp sge i32 %26, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %4
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %210

33:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %34, i32 0, i32 1
  %36 = call noundef ptr @_ZNKSt6vectorIN4Simd9Detection11HidHaarNodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #4
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %37, i64 %39
  %41 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !15
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %36, i64 %43
  store ptr %44, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %45, i32 0, i32 4
  %47 = call noundef ptr @_ZNKSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #4
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load i32, ptr %8, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %48, i64 %50
  %52 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = mul nsw i32 %53, 2
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds float, ptr %47, i64 %55
  store ptr %56, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %57 = load i32, ptr %8, align 4, !tbaa !11
  store i32 %57, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %58, i32 0, i32 3
  %60 = call noundef i64 @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %59) #4
  %61 = trunc i64 %60 to i32
  store i32 %61, ptr %15, align 4, !tbaa !11
  br label %62

62:                                               ; preds = %203, %33
  %63 = load i32, ptr %14, align 4, !tbaa !11
  %64 = load i32, ptr %15, align 4, !tbaa !11
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 2, ptr %11, align 4
  br label %206

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i32, ptr %14, align 4, !tbaa !11
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %68, i64 %70
  store ptr %71, ptr %16, align 8, !tbaa !5
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %72, i32 0, i32 4
  %74 = load i8, ptr %73, align 1, !tbaa !18, !range !19, !noundef !20
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %77

76:                                               ; preds = %67
  store i32 4, ptr %11, align 4
  br label %200

77:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load ptr, ptr %16, align 8, !tbaa !5
  %80 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !21
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %78, i64 %82
  store ptr %83, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store float 0.000000e+00, ptr %18, align 4, !tbaa !13
  %84 = load ptr, ptr %16, align 8, !tbaa !5
  %85 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %84, i32 0, i32 3
  %86 = load i8, ptr %85, align 4, !tbaa !22, !range !19, !noundef !20
  %87 = trunc i8 %86 to i1
  br i1 %87, label %88, label %146

88:                                               ; preds = %77
  br label %89

89:                                               ; preds = %140, %88
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  %92 = icmp ult ptr %90, %91
  br i1 %92, label %93, label %145

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %94, i32 0, i32 5
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !23
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN4Simd9Detection14HidHaarFeatureESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %99) #4
  store ptr %100, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %101 = load ptr, ptr %19, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %101, i32 0, i32 0
  %103 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %102, i64 0, i64 0
  %104 = load i64, ptr %7, align 8, !tbaa !9
  %105 = call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %103, i64 noundef %104)
  %106 = load ptr, ptr %19, align 8, !tbaa !5
  %107 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %106, i32 0, i32 0
  %108 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %107, i64 0, i64 1
  %109 = load i64, ptr %7, align 8, !tbaa !9
  %110 = call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %108, i64 noundef %109)
  %111 = fadd float %105, %110
  store float %111, ptr %20, align 4, !tbaa !13
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %113, i64 0, i64 2
  %115 = getelementptr inbounds %"struct.Simd::Detection::WeightedRect", ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !25
  %117 = icmp ne ptr %116, null
  br i1 %117, label %118, label %126

118:                                              ; preds = %93
  %119 = load ptr, ptr %19, align 8, !tbaa !5
  %120 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %119, i32 0, i32 0
  %121 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %120, i64 0, i64 2
  %122 = load i64, ptr %7, align 8, !tbaa !9
  %123 = call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %121, i64 noundef %122)
  %124 = load float, ptr %20, align 4, !tbaa !13
  %125 = fadd float %124, %123
  store float %125, ptr %20, align 4, !tbaa !13
  br label %126

126:                                              ; preds = %118, %93
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = load float, ptr %20, align 4, !tbaa !13
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %129, i32 0, i32 3
  %131 = load float, ptr %130, align 4, !tbaa !27
  %132 = load float, ptr %9, align 4, !tbaa !13
  %133 = fmul float %131, %132
  %134 = fcmp oge float %128, %133
  %135 = zext i1 %134 to i64
  %136 = getelementptr inbounds float, ptr %127, i64 %135
  %137 = load float, ptr %136, align 4, !tbaa !13
  %138 = load float, ptr %18, align 4, !tbaa !13
  %139 = fadd float %138, %137
  store float %139, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %140

140:                                              ; preds = %126
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %141, i32 1
  store ptr %142, ptr %12, align 8, !tbaa !5
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds float, ptr %143, i64 2
  store ptr %144, ptr %13, align 8, !tbaa !5
  br label %89, !llvm.loop !28

145:                                              ; preds = %89
  br label %189

146:                                              ; preds = %77
  br label %147

147:                                              ; preds = %183, %146
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = icmp ult ptr %148, %149
  br i1 %150, label %151, label %188

151:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.Simd::Detection::HidHaarCascade", ptr %152, i32 0, i32 5
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %154, i32 0, i32 0
  %156 = load i32, ptr %155, align 4, !tbaa !23
  %157 = sext i32 %156 to i64
  %158 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN4Simd9Detection14HidHaarFeatureESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %153, i64 noundef %157) #4
  store ptr %158, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %159 = load ptr, ptr %21, align 8, !tbaa !5
  %160 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %160, i64 0, i64 0
  %162 = load i64, ptr %7, align 8, !tbaa !9
  %163 = call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %161, i64 noundef %162)
  %164 = load ptr, ptr %21, align 8, !tbaa !5
  %165 = getelementptr inbounds %"struct.Simd::Detection::HidHaarFeature", ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds [3 x %"struct.Simd::Detection::WeightedRect"], ptr %165, i64 0, i64 1
  %167 = load i64, ptr %7, align 8, !tbaa !9
  %168 = call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %166, i64 noundef %167)
  %169 = fadd float %163, %168
  store float %169, ptr %22, align 4, !tbaa !13
  %170 = load ptr, ptr %13, align 8, !tbaa !5
  %171 = load float, ptr %22, align 4, !tbaa !13
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %172, i32 0, i32 3
  %174 = load float, ptr %173, align 4, !tbaa !27
  %175 = load float, ptr %9, align 4, !tbaa !13
  %176 = fmul float %174, %175
  %177 = fcmp oge float %171, %176
  %178 = zext i1 %177 to i64
  %179 = getelementptr inbounds float, ptr %170, i64 %178
  %180 = load float, ptr %179, align 4, !tbaa !13
  %181 = load float, ptr %18, align 4, !tbaa !13
  %182 = fadd float %181, %180
  store float %182, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %183

183:                                              ; preds = %151
  %184 = load ptr, ptr %12, align 8, !tbaa !5
  %185 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %184, i32 1
  store ptr %185, ptr %12, align 8, !tbaa !5
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds float, ptr %186, i64 2
  store ptr %187, ptr %13, align 8, !tbaa !5
  br label %147, !llvm.loop !30

188:                                              ; preds = %147
  br label %189

189:                                              ; preds = %188, %145
  %190 = load float, ptr %18, align 4, !tbaa !13
  %191 = load ptr, ptr %16, align 8, !tbaa !5
  %192 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %191, i32 0, i32 2
  %193 = load float, ptr %192, align 4, !tbaa !31
  %194 = fcmp olt float %190, %193
  br i1 %194, label %195, label %198

195:                                              ; preds = %189
  %196 = load i32, ptr %14, align 4, !tbaa !11
  %197 = sub nsw i32 0, %196
  store i32 %197, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %199

198:                                              ; preds = %189
  store i32 0, ptr %11, align 4
  br label %199

199:                                              ; preds = %198, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %200

200:                                              ; preds = %199, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %201 = load i32, ptr %11, align 4
  switch i32 %201, label %206 [
    i32 0, label %202
    i32 4, label %203
  ]

202:                                              ; preds = %200
  br label %203

203:                                              ; preds = %202, %200
  %204 = load i32, ptr %14, align 4, !tbaa !11
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %14, align 4, !tbaa !11
  br label %62, !llvm.loop !32

206:                                              ; preds = %200, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %207 = load i32, ptr %11, align 4
  switch i32 %207, label %209 [
    i32 2, label %208
  ]

208:                                              ; preds = %206
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %209

209:                                              ; preds = %208, %206
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %210

210:                                              ; preds = %209, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %211 = load i32, ptr %5, align 4
  ret i32 %211
}

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = { alwaysinline 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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !12, i64 0}
!16 = !{!"_ZTSN4Simd9Detection12HidHaarStageE", !12, i64 0, !12, i64 4, !14, i64 8, !17, i64 12, !17, i64 13}
!17 = !{!"bool", !7, i64 0}
!18 = !{!16, !17, i64 13}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!16, !12, i64 4}
!22 = !{!16, !17, i64 12}
!23 = !{!24, !12, i64 0}
!24 = !{!"_ZTSN4Simd9Detection11HidHaarNodeE", !12, i64 0, !12, i64 4, !12, i64 8, !14, i64 12}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTSN4Simd9Detection12WeightedRectE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32}
!27 = !{!24, !14, i64 12}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = !{!16, !14, i64 8}
!32 = distinct !{!32, !29}


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

%"struct.Simd::Detection::HidHaarStage" = type { i32, i32, float, i8, i8 }
%"struct.Simd::Detection::HidHaarNode" = type { i32, i32, i32, float }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN4Simd4Base9Detect32fERKNS_9Detection14HidHaarCascadeEmif(ptr noundef nonnull align 8 dereferenceable(472) %0, i64 noundef %1, i32 noundef %2, float noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 88
  %6 = tail call noundef ptr @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #2
  %7 = tail call noundef i64 @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #2
  %8 = trunc i64 %7 to i32
  %.not = icmp sgt i32 %8, %2
  br i1 %.not, label %9, label %.loopexit89

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = tail call noundef ptr @_ZNKSt6vectorIN4Simd9Detection11HidHaarNodeESaIS2_EE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #2
  %12 = sext i32 %2 to i64
  %13 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %6, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 112
  %16 = tail call noundef ptr @_ZNKSt6vectorIfSaIfEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #2
  %17 = load i32, ptr %13, align 4, !tbaa !5
  %18 = tail call noundef i64 @_ZNKSt6vectorIN4Simd9Detection12HidHaarStageESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #2
  %19 = trunc i64 %18 to i32
  %.not79104 = icmp sgt i32 %19, %2
  br i1 %.not79104, label %.lr.ph108, label %.loopexit89

.lr.ph108:                                        ; preds = %9
  %20 = shl nsw i32 %17, 1
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds float, ptr %16, i64 %21
  %23 = sext i32 %14 to i64
  %24 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %11, i64 %23
  %25 = getelementptr inbounds i8, ptr %0, i64 136
  br label %26

26:                                               ; preds = %.lr.ph108, %85
  %indvars.iv = phi i64 [ %12, %.lr.ph108 ], [ %indvars.iv.next, %85 ]
  %.063107 = phi ptr [ %24, %.lr.ph108 ], [ %.467.ph, %85 ]
  %.071106 = phi ptr [ %22, %.lr.ph108 ], [ %.475.ph, %85 ]
  %27 = getelementptr inbounds %"struct.Simd::Detection::HidHaarStage", ptr %6, i64 %indvars.iv
  %28 = getelementptr inbounds i8, ptr %27, i64 13
  %29 = load i8, ptr %28, align 1, !tbaa !12, !range !13, !noundef !14
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %85, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %27, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !15
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %"struct.Simd::Detection::HidHaarNode", ptr %.063107, i64 %34
  %36 = getelementptr inbounds i8, ptr %27, i64 12
  %37 = load i8, ptr %36, align 4, !tbaa !16, !range !13, !noundef !14
  %38 = trunc nuw i8 %37 to i1
  %39 = icmp sgt i32 %33, 0
  br i1 %38, label %.preheader, label %.preheader87

.preheader87:                                     ; preds = %31
  br i1 %39, label %.lr.ph, label %.loopexit

.preheader:                                       ; preds = %31
  br i1 %39, label %.lr.ph98, label %.loopexit

.lr.ph98:                                         ; preds = %.preheader, %52
  %.16497 = phi ptr [ %61, %52 ], [ %.063107, %.preheader ]
  %.06896 = phi float [ %60, %52 ], [ 0.000000e+00, %.preheader ]
  %.17295 = phi ptr [ %62, %52 ], [ %.071106, %.preheader ]
  %40 = load i32, ptr %.16497, align 4, !tbaa !17
  %41 = sext i32 %40 to i64
  %42 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN4Simd9Detection14HidHaarFeatureESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %41) #2
  %43 = tail call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %42, i64 noundef %1)
  %44 = getelementptr inbounds i8, ptr %42, i64 40
  %45 = tail call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %44, i64 noundef %1)
  %46 = fadd float %43, %45
  %47 = getelementptr inbounds i8, ptr %42, i64 80
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %.not78 = icmp eq ptr %48, null
  br i1 %.not78, label %52, label %49

49:                                               ; preds = %.lr.ph98
  %50 = tail call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %47, i64 noundef %1)
  %51 = fadd float %46, %50
  br label %52

52:                                               ; preds = %49, %.lr.ph98
  %.062 = phi float [ %51, %49 ], [ %46, %.lr.ph98 ]
  %53 = getelementptr inbounds i8, ptr %.16497, i64 12
  %54 = load float, ptr %53, align 4, !tbaa !22
  %55 = fmul float %54, %3
  %56 = fcmp oge float %.062, %55
  %57 = zext i1 %56 to i64
  %58 = getelementptr inbounds float, ptr %.17295, i64 %57
  %59 = load float, ptr %58, align 4, !tbaa !23
  %60 = fadd float %.06896, %59
  %61 = getelementptr inbounds i8, ptr %.16497, i64 16
  %62 = getelementptr inbounds i8, ptr %.17295, i64 8
  %63 = icmp ult ptr %61, %35
  br i1 %63, label %.lr.ph98, label %.loopexit, !llvm.loop !24

.lr.ph:                                           ; preds = %.preheader87, %.lr.ph
  %.26592 = phi ptr [ %79, %.lr.ph ], [ %.063107, %.preheader87 ]
  %.16991 = phi float [ %78, %.lr.ph ], [ 0.000000e+00, %.preheader87 ]
  %.27390 = phi ptr [ %80, %.lr.ph ], [ %.071106, %.preheader87 ]
  %64 = load i32, ptr %.26592, align 4, !tbaa !17
  %65 = sext i32 %64 to i64
  %66 = tail call noundef nonnull align 8 dereferenceable(120) ptr @_ZNKSt6vectorIN4Simd9Detection14HidHaarFeatureESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %25, i64 noundef %65) #2
  %67 = tail call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %66, i64 noundef %1)
  %68 = getelementptr inbounds i8, ptr %66, i64 40
  %69 = tail call noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40) %68, i64 noundef %1)
  %70 = fadd float %67, %69
  %71 = getelementptr inbounds i8, ptr %.26592, i64 12
  %72 = load float, ptr %71, align 4, !tbaa !22
  %73 = fmul float %72, %3
  %74 = fcmp oge float %70, %73
  %75 = zext i1 %74 to i64
  %76 = getelementptr inbounds float, ptr %.27390, i64 %75
  %77 = load float, ptr %76, align 4, !tbaa !23
  %78 = fadd float %.16991, %77
  %79 = getelementptr inbounds i8, ptr %.26592, i64 16
  %80 = getelementptr inbounds i8, ptr %.27390, i64 8
  %81 = icmp ult ptr %79, %35
  br i1 %81, label %.lr.ph, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %.lr.ph, %52, %.preheader87, %.preheader
  %.374 = phi ptr [ %.071106, %.preheader ], [ %.071106, %.preheader87 ], [ %62, %52 ], [ %80, %.lr.ph ]
  %.270 = phi float [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader87 ], [ %60, %52 ], [ %78, %.lr.ph ]
  %.366 = phi ptr [ %.063107, %.preheader ], [ %.063107, %.preheader87 ], [ %61, %52 ], [ %79, %.lr.ph ]
  %82 = getelementptr inbounds i8, ptr %27, i64 8
  %83 = load float, ptr %82, align 4, !tbaa !27
  %84 = fcmp olt float %.270, %83
  br i1 %84, label %.loopexit89.split.loop.exit, label %85

85:                                               ; preds = %.loopexit, %26
  %.475.ph = phi ptr [ %.071106, %26 ], [ %.374, %.loopexit ]
  %.467.ph = phi ptr [ %.063107, %26 ], [ %.366, %.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %19
  br i1 %exitcond.not, label %.loopexit89, label %26, !llvm.loop !28

.loopexit89.split.loop.exit:                      ; preds = %.loopexit
  %86 = trunc nsw i64 %indvars.iv to i32
  %87 = sub nsw i32 0, %86
  br label %.loopexit89

.loopexit89:                                      ; preds = %85, %.loopexit89.split.loop.exit, %9, %4
  %.5 = phi i32 [ 1, %4 ], [ %87, %.loopexit89.split.loop.exit ], [ 1, %9 ], [ 1, %85 ]
  ret i32 %.5
}

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

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

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd4Base14WeightedSum32fERKNS_9Detection12WeightedRectEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { alwaysinline 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 = { 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, !7, i64 0}
!6 = !{!"_ZTSN4Simd9Detection12HidHaarStageE", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 12, !11, i64 13}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!6, !11, i64 13}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !7, i64 4}
!16 = !{!6, !11, i64 12}
!17 = !{!18, !7, i64 0}
!18 = !{!"_ZTSN4Simd9Detection11HidHaarNodeE", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTSN4Simd9Detection12WeightedRectE", !21, i64 0, !21, i64 8, !21, i64 16, !21, i64 24, !10, i64 32}
!21 = !{!"any pointer", !8, i64 0}
!22 = !{!18, !10, i64 12}
!23 = !{!10, !10, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!6, !10, i64 8}
!28 = distinct !{!28, !25}


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