; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_frontend)

; 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::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.52 = type { ptr, i32, i32, ptr }
%"class.basisu::basisu_frontend" = type { %"struct.basisu::basisu_frontend::params", i32, i32, i8, i8, i8, i32, i32, %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::tree_vector_quant", %"class.basisu::vector.6", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.6", %"class.basisu::vector.0", %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.6", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.18", %"class.basisu::vector.20", %"class.std::mutex" }
%"struct.basisu::basisu_frontend::params" = type { i32, ptr, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, i8, float, i32, ptr, ptr }
%"class.basisu::vector" = type { ptr, i32, i32 }
%"class.basisu::tree_vector_quant" = type <{ %"class.basisu::vector.2", %"class.basisu::vector.4", i32, [4 x i8] }>
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"class.basisu::vector.20" = type { ptr, i32, i32 }
%"class.std::mutex" = type { %"class.std::__mutex_base" }
%"class.std::__mutex_base" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@.str.25 = external hidden unnamed_addr constant [32 x i8], align 1

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend30init_endpoint_training_vectorsEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::function", align 8
  %9 = alloca %class.anon.52, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.25)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %13 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 12
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu17tree_vector_quantINS_3vecILj6EfEEE17get_training_vecsEv(ptr noundef nonnull align 8 dereferenceable(36) %13)
  store ptr %14, ptr %3, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = mul i32 %17, 2
  %19 = zext i32 %18 to i64
  call void @_ZN6basisu6vectorISt4pairINS_3vecILj6EfEEmEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %19, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 16384, ptr %4, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !31
  br label %20

20:                                               ; preds = %44, %1
  %21 = load i32, ptr %5, align 4, !tbaa !31
  %22 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 1
  %23 = load i32, ptr %22, align 8, !tbaa !9
  %24 = icmp ult i32 %21, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %51

26:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %27 = load i32, ptr %5, align 4, !tbaa !31
  store i32 %27, ptr %6, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %28 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = load i32, ptr %6, align 4, !tbaa !31
  %31 = add i32 %30, 16384
  %32 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %29, i32 noundef %31)
  store i32 %32, ptr %7, align 4, !tbaa !31
  %33 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %33, i32 0, i32 19
  %35 = load ptr, ptr %34, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  %36 = getelementptr inbounds %class.anon.52, ptr %9, i32 0, i32 0
  store ptr %12, ptr %36, align 8, !tbaa !33
  %37 = getelementptr inbounds %class.anon.52, ptr %9, i32 0, i32 1
  %38 = load i32, ptr %6, align 4, !tbaa !31
  store i32 %38, ptr %37, align 8, !tbaa !35
  %39 = getelementptr inbounds %class.anon.52, ptr %9, i32 0, i32 2
  %40 = load i32, ptr %7, align 4, !tbaa !31
  store i32 %40, ptr %39, align 4, !tbaa !36
  %41 = getelementptr inbounds %class.anon.52, ptr %9, i32 0, i32 3
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %42, ptr %41, align 8, !tbaa !5
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(24) %9)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %35, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %43 unwind label %47

43:                                               ; preds = %26
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %5, align 4, !tbaa !31
  %46 = add i32 %45, 16384
  store i32 %46, ptr %5, align 4, !tbaa !31
  br label %20, !llvm.loop !37

47:                                               ; preds = %26
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %10, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %11, align 4
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %55

51:                                               ; preds = %25
  %52 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 0
  %53 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %52, i32 0, i32 19
  %54 = load ptr, ptr %53, align 8, !tbaa !32
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %54)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret void

55:                                               ; preds = %47
  %56 = load ptr, ptr %10, align 8
  %57 = load i32, ptr %11, align 4
  %58 = insertvalue { ptr, i32 } poison, ptr %56, 0
  %59 = insertvalue { ptr, i32 } %58, i32 %57, 1
  resume { ptr, i32 } %59
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) #3

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu17tree_vector_quantINS_3vecILj6EfEEE17get_training_vecsEv(ptr noundef nonnull align 8 dereferenceable(36)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorISt4pairINS_3vecILj6EfEEmEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) #5 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #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 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 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 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 88}
!10 = !{!"_ZTSN6basisu15basisu_frontendE", !11, i64 0, !12, i64 88, !12, i64 92, !13, i64 96, !13, i64 97, !13, i64 98, !12, i64 100, !12, i64 104, !16, i64 112, !17, i64 128, !17, i64 144, !17, i64 160, !18, i64 176, !21, i64 216, !21, i64 232, !22, i64 248, !21, i64 264, !23, i64 280, !24, i64 296, !21, i64 312, !17, i64 328, !21, i64 344, !22, i64 360, !21, i64 376, !25, i64 392, !26, i64 408, !27, i64 424, !28, i64 440, !29, i64 456}
!11 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !13, i64 28, !13, i64 29, !13, i64 30, !13, i64 31, !13, i64 32, !13, i64 33, !13, i64 34, !6, i64 40, !12, i64 48, !12, i64 52, !13, i64 56, !14, i64 60, !15, i64 64, !6, i64 72, !6, i64 80}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTSN6basist18basis_texture_typeE", !7, i64 0}
!16 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!17 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!18 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !19, i64 0, !20, i64 16, !12, i64 32}
!19 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!20 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!21 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!22 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !12, i64 8, !12, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIbEE", !6, i64 0, !12, i64 8, !12, i64 12}
!27 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !12, i64 8, !12, i64 12}
!28 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !6, i64 0, !12, i64 8, !12, i64 12}
!29 = !{!"_ZTSSt5mutex", !30, i64 0}
!30 = !{!"_ZTSSt12__mutex_base", !7, i64 0}
!31 = !{!12, !12, i64 0}
!32 = !{!10, !6, i64 80}
!33 = !{!34, !6, i64 0}
!34 = !{!"_ZTSZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16}
!35 = !{!34, !12, i64 8}
!36 = !{!34, !12, i64 12}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


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

%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.anon.52 = type { ptr, i32, i32, ptr }

@.str.25 = external hidden unnamed_addr constant [32 x i8], align 1

declare void @_ZN6basisu12debug_printfEPKcz(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend30init_endpoint_training_vectorsEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::function", align 8
  %3 = alloca %class.anon.52, align 8
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.25)
  %4 = getelementptr inbounds i8, ptr %0, i64 176
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu17tree_vector_quantINS_3vecILj6EfEEE17get_training_vecsEv(ptr noundef nonnull align 8 dereferenceable(36) %4)
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = shl i32 %7, 1
  %9 = zext i32 %8 to i64
  tail call void @_ZN6basisu6vectorISt4pairINS_3vecILj6EfEEmEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %9, i1 noundef zeroext false)
  %10 = load i32, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 80
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  %13 = getelementptr inbounds i8, ptr %3, i64 12
  %14 = getelementptr inbounds i8, ptr %3, i64 16
  br label %17

._crit_edge:                                      ; preds = %22, %1
  %15 = getelementptr inbounds i8, ptr %0, i64 80
  %16 = load ptr, ptr %15, align 8, !tbaa !30
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %16)
  ret void

17:                                               ; preds = %.lr.ph, %22
  %18 = phi i32 [ %10, %.lr.ph ], [ %23, %22 ]
  %.011 = phi i32 [ 0, %.lr.ph ], [ %19, %22 ]
  %19 = add i32 %.011, 16384
  %20 = call noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef %18, i32 noundef %19)
  %21 = load ptr, ptr %11, align 8, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  store ptr %0, ptr %3, align 8, !tbaa !31
  store i32 %.011, ptr %12, align 8, !tbaa !33
  store i32 %20, ptr %13, align 4, !tbaa !34
  store ptr %5, ptr %14, align 8, !tbaa !35
  call void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull align 8 dereferenceable(24) %3)
  invoke void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189) %21, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %22 unwind label %25

22:                                               ; preds = %17
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  %23 = load i32, ptr %6, align 8, !tbaa !5
  %24 = icmp ult i32 %19, %23
  br i1 %24, label %17, label %._crit_edge, !llvm.loop !36

25:                                               ; preds = %17
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  resume { ptr, i32 } %26
}

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIjEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @_ZN6basisu8job_pool7add_jobEOSt8functionIFvvEE(ptr noundef nonnull align 8 dereferenceable(189), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu17tree_vector_quantINS_3vecILj6EfEEE17get_training_vecsEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorISt4pairINS_3vecILj6EfEEmEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #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 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 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 = { 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 #5 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 88}
!6 = !{!"_ZTSN6basisu15basisu_frontendE", !7, i64 0, !8, i64 88, !8, i64 92, !12, i64 96, !12, i64 97, !12, i64 98, !8, i64 100, !8, i64 104, !15, i64 112, !16, i64 128, !16, i64 144, !16, i64 160, !17, i64 176, !20, i64 216, !20, i64 232, !21, i64 248, !20, i64 264, !22, i64 280, !23, i64 296, !20, i64 312, !16, i64 328, !20, i64 344, !21, i64 360, !20, i64 376, !24, i64 392, !25, i64 408, !26, i64 424, !27, i64 440, !28, i64 456}
!7 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !8, i64 0, !11, i64 8, !8, i64 16, !8, i64 20, !8, i64 24, !12, i64 28, !12, i64 29, !12, i64 30, !12, i64 31, !12, i64 32, !12, i64 33, !12, i64 34, !11, i64 40, !8, i64 48, !8, i64 52, !12, i64 56, !13, i64 60, !14, i64 64, !11, i64 72, !11, i64 80}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"float", !9, i64 0}
!14 = !{!"_ZTSN6basist18basis_texture_typeE", !9, i64 0}
!15 = !{!"_ZTSN6basisu6vectorINS_11pixel_blockEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!16 = !{!"_ZTSN6basisu6vectorINS_9etc_blockEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!17 = !{!"_ZTSN6basisu17tree_vector_quantINS_3vecILj6EfEEEE", !18, i64 0, !19, i64 16, !8, i64 32}
!18 = !{!"_ZTSN6basisu6vectorINS_17tree_vector_quantINS_3vecILj6EfEEE9tsvq_nodeEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!19 = !{!"_ZTSN6basisu6vectorISt4pairINS_3vecILj6EfEEmEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS0_IjEEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!21 = !{!"_ZTSN6basisu6vectorIhEE", !11, i64 0, !8, i64 8, !8, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27endpoint_cluster_etc_paramsEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_5vec2UEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!24 = !{!"_ZTSN6basisu6vectorIN6basist38etc1_global_selector_codebook_entry_idEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIbEE", !11, i64 0, !8, i64 8, !8, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIjEE", !11, i64 0, !8, i64 8, !8, i64 12}
!27 = !{!"_ZTSN6basisu6vectorINS_15basisu_frontend27subblock_endpoint_quant_errEEE", !11, i64 0, !8, i64 8, !8, i64 12}
!28 = !{!"_ZTSSt5mutex", !29, i64 0}
!29 = !{!"_ZTSSt12__mutex_base", !9, i64 0}
!30 = !{!6, !11, i64 80}
!31 = !{!32, !11, i64 0}
!32 = !{!"_ZTSZN6basisu15basisu_frontend30init_endpoint_training_vectorsEvE3$_0", !11, i64 0, !8, i64 8, !8, i64 12, !11, i64 16}
!33 = !{!32, !8, i64 8}
!34 = !{!32, !8, i64 12}
!35 = !{!11, !11, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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