; LLVM IR from sp-nitech/SPTK :: src/compression (inverse_multistage_vector_quantization)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i8 }
%"class.sptk::InverseMultistageVectorQuantization" = type <{ ptr, i32, i32, %"class.sptk::InverseVectorQuantization", i8, [7 x i8] }>
%"class.sptk::InverseVectorQuantization" = type <{ ptr, i32, i8, [3 x i8] }>
%"class.sptk::InverseMultistageVectorQuantization::Buffer" = type { ptr, %"class.std::vector.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk35InverseMultistageVectorQuantization3RunERKSt6vectorIiSaIiEERKS1_IS1_IS1_IdSaIdEESaIS7_EESaIS9_EEPS7_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %3, ptr noundef %4) #0 align 2 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %class.anon, align 1
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %24 = load ptr, ptr %7, align 8
  %25 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 4
  %26 = load i8, ptr %25, align 8, !tbaa !9, !range !14, !noundef !15
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %48

28:                                               ; preds = %5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  %31 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 2
  %32 = load i32, ptr %31, align 4, !tbaa !16
  %33 = sext i32 %32 to i64
  %34 = icmp ne i64 %30, %33
  br i1 %34, label %48, label %35

35:                                               ; preds = %28
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = call noundef i64 @_ZNKSt6vectorIS_IS_IdSaIdEESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #5
  %38 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 2
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = sext i32 %39 to i64
  %41 = icmp ne i64 %37, %40
  br i1 %41, label %48, label %42

42:                                               ; preds = %35
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = icmp eq ptr null, %43
  br i1 %44, label %48, label %45

45:                                               ; preds = %42
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = icmp eq ptr null, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %45, %42, %35, %28, %5
  store i1 false, ptr %6, align 1
  br label %138

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %50 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !17
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %12, align 4, !tbaa !18
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %53) #5
  %55 = load i32, ptr %12, align 4, !tbaa !18
  %56 = sext i32 %55 to i64
  %57 = icmp ne i64 %54, %56
  br i1 %57, label %58, label %62

58:                                               ; preds = %49
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load i32, ptr %12, align 4, !tbaa !18
  %61 = sext i32 %60 to i64
  call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef %61)
  br label %62

62:                                               ; preds = %58, %49
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization::Buffer", ptr %63, i32 0, i32 1
  %65 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %64) #5
  %66 = load i32, ptr %12, align 4, !tbaa !18
  %67 = sext i32 %66 to i64
  %68 = icmp ne i64 %65, %67
  br i1 %68, label %69, label %74

69:                                               ; preds = %62
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization::Buffer", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %12, align 4, !tbaa !18
  %73 = sext i32 %72 to i64
  call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %73)
  br label %74

74:                                               ; preds = %69, %62
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #5
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %78) #5
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %79, ptr %80, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store double 0.000000e+00, ptr %15, align 8, !tbaa !19
  %81 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8
  %83 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEdEvT_S7_RKT0_(ptr %82, ptr %84, ptr noundef nonnull align 8 dereferenceable(8) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !18
  br label %85

85:                                               ; preds = %131, %74
  %86 = load i32, ptr %16, align 4, !tbaa !18
  %87 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !16
  %89 = icmp slt i32 %86, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %85
  store i32 2, ptr %17, align 4
  br label %134

91:                                               ; preds = %85
  %92 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization", ptr %24, i32 0, i32 3
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = load i32, ptr %16, align 4, !tbaa !18
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #5
  %97 = load i32, ptr %96, align 4, !tbaa !18
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i32, ptr %16, align 4, !tbaa !18
  %100 = sext i32 %99 to i64
  %101 = call noundef nonnull align 1 ptr @_ZNKSt6vectorIS_IS_IdSaIdEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %98, i64 noundef %100) #5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization::Buffer", ptr %102, i32 0, i32 1
  %104 = call noundef zeroext i1 @_ZNK4sptk25InverseVectorQuantization3RunEiRKSt6vectorIS1_IdSaIdEESaIS3_EEPS3_(ptr noundef nonnull align 8 dereferenceable(13) %92, i32 noundef %97, ptr noundef nonnull align 1 %101, ptr noundef %103)
  br i1 %104, label %106, label %105

105:                                              ; preds = %91
  store i1 false, ptr %6, align 1
  store i32 1, ptr %17, align 4
  br label %134

106:                                              ; preds = %91
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization::Buffer", ptr %107, i32 0, i32 1
  %109 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %108) #5
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.sptk::InverseMultistageVectorQuantization::Buffer", ptr %111, i32 0, i32 1
  %113 = call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #5
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %115) #5
  %117 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %118) #5
  %120 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8
  %127 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8
  %129 = call ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_S6_ZNK4sptk35InverseMultistageVectorQuantization3RunERKS3_IiSaIiEERKS3_IS3_IS5_SaIS5_EESaISE_EEPS5_PNS8_6BufferEE3$_0ET1_T_SO_T0_SN_T2_"(ptr %122, ptr %124, ptr %126, ptr %128)
  %130 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %129, ptr %130, align 8
  br label %131

131:                                              ; preds = %106
  %132 = load i32, ptr %16, align 4, !tbaa !18
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %16, align 4, !tbaa !18
  br label %85, !llvm.loop !21

134:                                              ; preds = %105, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %135 = load i32, ptr %17, align 4
  switch i32 %135, label %137 [
    i32 2, label %136
  ]

136:                                              ; preds = %134
  store i1 true, ptr %6, align 1
  store i32 1, ptr %17, align 4
  br label %137

137:                                              ; preds = %136, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %138

138:                                              ; preds = %137, %48
  %139 = load i1, ptr %6, align 1
  ret i1 %139
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEdEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

declare noundef zeroext i1 @_ZNK4sptk25InverseVectorQuantization3RunEiRKSt6vectorIS1_IdSaIdEESaIS3_EEPS3_(ptr noundef nonnull align 8 dereferenceable(13), i32 noundef, ptr noundef nonnull align 1, ptr noundef) #4

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

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_S6_ZNK4sptk35InverseMultistageVectorQuantization3RunERKS3_IiSaIiEERKS3_IS3_IS5_SaIS5_EESaISE_EEPS5_PNS8_6BufferEE3$_0ET1_T_SO_T0_SN_T2_"(ptr, ptr, ptr, ptr) #0

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 = { inlinehint 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 32}
!10 = !{!"_ZTSN4sptk35InverseMultistageVectorQuantizationE", !11, i64 8, !11, i64 12, !12, i64 16, !13, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4sptk25InverseVectorQuantizationE", !11, i64 8, !13, i64 12}
!13 = !{!"bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!10, !11, i64 12}
!17 = !{!10, !11, i64 8}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4sptk35InverseMultistageVectorQuantization3RunERKSt6vectorIiSaIiEERKS1_IS1_IS1_IdSaIdEESaIS7_EESaIS9_EEPS7_PNS0_6BufferE(ptr noundef nonnull align 8 dereferenceable(33) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 align 2 {
  %6 = alloca double, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  %8 = load i8, ptr %7, align 8, !tbaa !5, !range !12, !noundef !13
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %.critedge

10:                                               ; preds = %5
  %11 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !14
  %14 = sext i32 %13 to i64
  %.not = icmp eq i64 %11, %14
  br i1 %.not, label %15, label %.critedge

15:                                               ; preds = %10
  %16 = tail call noundef i64 @_ZNKSt6vectorIS_IS_IdSaIdEESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %17 = load i32, ptr %12, align 4, !tbaa !14
  %18 = sext i32 %17 to i64
  %19 = icmp ne i64 %16, %18
  %20 = icmp eq ptr %3, null
  %or.cond = or i1 %20, %19
  %21 = icmp eq ptr %4, null
  %or.cond3 = or i1 %21, %or.cond
  br i1 %or.cond3, label %.critedge, label %22

22:                                               ; preds = %15
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !15
  %25 = add nsw i32 %24, 1
  %26 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %27 = sext i32 %25 to i64
  %.not41 = icmp eq i64 %26, %27
  br i1 %.not41, label %29, label %28

28:                                               ; preds = %22
  tail call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %27)
  br label %29

29:                                               ; preds = %28, %22
  %30 = getelementptr inbounds i8, ptr %4, i64 8
  %31 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %.not42 = icmp eq i64 %31, %27
  br i1 %.not42, label %33, label %32

32:                                               ; preds = %29
  tail call void @_ZNSt6vectorIdSaIdEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %27)
  br label %33

33:                                               ; preds = %32, %29
  %34 = tail call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %35 = tail call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store double 0.000000e+00, ptr %6, align 8, !tbaa !16
  call void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEdEvT_S7_RKT0_(ptr %34, ptr %35, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %36 = load i32, ptr %12, align 4, !tbaa !14
  %.not43.not44 = icmp sgt i32 %36, 0
  br i1 %.not43.not44, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %33
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  br label %38

38:                                               ; preds = %.lr.ph, %43
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %43 ]
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #5
  %40 = load i32, ptr %39, align 4, !tbaa !18
  %41 = call noundef nonnull align 1 ptr @_ZNKSt6vectorIS_IS_IdSaIdEESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %42 = call noundef zeroext i1 @_ZNK4sptk25InverseVectorQuantization3RunEiRKSt6vectorIS1_IdSaIdEESaIS3_EEPS3_(ptr noundef nonnull align 8 dereferenceable(13) %37, i32 noundef %40, ptr noundef nonnull align 1 %41, ptr noundef nonnull %30)
  br i1 %42, label %43, label %.critedge

43:                                               ; preds = %38
  %44 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %45 = call ptr @_ZNSt6vectorIdSaIdEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %46 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %47 = call ptr @_ZNSt6vectorIdSaIdEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %48 = call ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_S6_ZNK4sptk35InverseMultistageVectorQuantization3RunERKS3_IiSaIiEERKS3_IS3_IS5_SaIS5_EESaISE_EEPS5_PNS8_6BufferEE3$_0ET1_T_SO_T0_SN_T2_"(ptr %44, ptr %45, ptr %46, ptr %47)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = load i32, ptr %12, align 4, !tbaa !14
  %50 = sext i32 %49 to i64
  %.not43.not = icmp slt i64 %indvars.iv.next, %50
  br i1 %.not43.not, label %38, label %.critedge, !llvm.loop !19

.critedge:                                        ; preds = %38, %43, %33, %5, %10, %15
  %.2 = phi i1 [ false, %15 ], [ false, %10 ], [ false, %5 ], [ true, %33 ], [ %42, %43 ], [ %42, %38 ]
  ret i1 %.2
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEEdEvT_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

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

declare noundef zeroext i1 @_ZNK4sptk25InverseVectorQuantization3RunEiRKSt6vectorIS1_IdSaIdEESaIS3_EEPS3_(ptr noundef nonnull align 8 dereferenceable(13), i32 noundef, ptr noundef nonnull align 1, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare hidden ptr @"_ZSt9transformIN9__gnu_cxx17__normal_iteratorIPdSt6vectorIdSaIdEEEES6_S6_ZNK4sptk35InverseMultistageVectorQuantization3RunERKS3_IiSaIiEERKS3_IS3_IS5_SaIS5_EESaISE_EEPS5_PNS8_6BufferEE3$_0ET1_T_SO_T0_SN_T2_"(ptr, ptr, ptr, ptr) local_unnamed_addr #0

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 = { inlinehint 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 32}
!6 = !{!"_ZTSN4sptk35InverseMultistageVectorQuantizationE", !7, i64 8, !7, i64 12, !10, i64 16, !11, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4sptk25InverseVectorQuantizationE", !7, i64 8, !11, i64 12}
!11 = !{!"bool", !8, i64 0}
!12 = !{i8 0, i8 2}
!13 = !{}
!14 = !{!6, !7, i64 12}
!15 = !{!6, !7, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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