; 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.basisu::interval_timer" = type <{ i64, i64, i8, i8, [6 x i8] }>
%"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.51 = type { ptr, i32, i32 }
%"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.23 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend16init_etc1_imagesEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.basisu::interval_timer", 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.51, 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.23)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  call void @_ZN6basisu14interval_timerC1Ev(ptr noundef nonnull align 8 dereferenceable(18) %3)
  call void @_ZN6basisu14interval_timer5startEv(ptr noundef nonnull align 8 dereferenceable(18) %3)
  %13 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 11
  %14 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 1
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = zext i32 %15 to i64
  call void @_ZN6basisu6vectorINS_9etc_blockEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %16, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 4096, 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 %17

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

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

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

38:                                               ; preds = %23
  call void @_ZNSt14_Function_baseD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, 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 %39

39:                                               ; preds = %38
  %40 = load i32, ptr %5, align 4, !tbaa !31
  %41 = add i32 %40, 4096
  store i32 %41, ptr %5, align 4, !tbaa !31
  br label %17, !llvm.loop !37

42:                                               ; preds = %23
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, 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 16, 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 24, ptr %3) #6
  br label %51

46:                                               ; preds = %22
  %47 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 0
  %48 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %47, i32 0, i32 19
  %49 = load ptr, ptr %48, align 8, !tbaa !32
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %49)
  %50 = call noundef double @_ZNK6basisu14interval_timer16get_elapsed_secsEv(ptr noundef nonnull align 8 dereferenceable(18) %3)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.24, double noundef %50)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  ret void

51:                                               ; preds = %42
  %52 = load ptr, ptr %10, align 8
  %53 = load i32, ptr %11, align 4
  %54 = insertvalue { ptr, i32 } poison, ptr %52, 0
  %55 = insertvalue { ptr, i32 } %54, i32 %53, 1
  resume { ptr, i32 } %55
}

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

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

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

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 #5 align 2

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

declare void @_ZN6basisu14interval_timerC1Ev(ptr noundef nonnull align 8 dereferenceable(18)) unnamed_addr #0

declare void @_ZN6basisu14interval_timer5startEv(ptr noundef nonnull align 8 dereferenceable(18)) #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend16init_etc1_imagesEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

declare noundef double @_ZNK6basisu14interval_timer16get_elapsed_secsEv(ptr noundef nonnull align 8 dereferenceable(18)) #0

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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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_frontend16init_etc1_imagesEvE3$_0", !6, i64 0, !12, i64 8, !12, i64 12}
!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.basisu::interval_timer" = type <{ i64, i64, i8, i8, [6 x i8] }>
%"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.51 = type { ptr, i32, i32 }

@.str.23 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend16init_etc1_imagesEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.basisu::interval_timer", align 8
  %3 = alloca %"class.std::function", align 8
  %4 = alloca %class.anon.51, align 8
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.23)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZN6basisu14interval_timerC1Ev(ptr noundef nonnull align 8 dereferenceable(18) %2)
  call void @_ZN6basisu14interval_timer5startEv(ptr noundef nonnull align 8 dereferenceable(18) %2)
  %5 = getelementptr inbounds i8, ptr %0, i64 160
  %6 = getelementptr inbounds i8, ptr %0, i64 88
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = zext i32 %7 to i64
  call void @_ZN6basisu6vectorINS_9etc_blockEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %5, i64 noundef %8, i1 noundef zeroext false)
  %9 = load i32, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 80
  %11 = getelementptr inbounds i8, ptr %4, i64 8
  %12 = getelementptr inbounds i8, ptr %4, i64 12
  br label %16

._crit_edge:                                      ; preds = %21, %1
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load ptr, ptr %13, align 8, !tbaa !30
  call void @_ZN6basisu8job_pool12wait_for_allEv(ptr noundef nonnull align 8 dereferenceable(189) %14)
  %15 = call noundef double @_ZNK6basisu14interval_timer16get_elapsed_secsEv(ptr noundef nonnull align 8 dereferenceable(18) %2)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.24, double noundef %15)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  ret void

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

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

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

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

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

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

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 #5 align 2

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

declare void @_ZN6basisu14interval_timerC1Ev(ptr noundef nonnull align 8 dereferenceable(18)) unnamed_addr #0

declare void @_ZN6basisu14interval_timer5startEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @"_ZNSt8functionIFvvEEC2IZN6basisu15basisu_frontend16init_etc1_imagesEvE3$_0vEEOT_"(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

declare noundef double @_ZNK6basisu14interval_timer16get_elapsed_secsEv(ptr noundef nonnull align 8 dereferenceable(18)) local_unnamed_addr #0

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 = { 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 #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #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_frontend16init_etc1_imagesEvE3$_0", !11, i64 0, !8, i64 8, !8, i64 12}
!33 = !{!32, !8, i64 8}
!34 = !{!32, !8, i64 12}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


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