; 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::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 }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL21handle_verify_failureEi(i32 noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend32generate_block_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  %13 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 18
  %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_5vec2UEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %16, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !31
  br label %17

17:                                               ; preds = %58, %1
  %18 = load i32, ptr %3, align 4, !tbaa !31
  %19 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 13
  %20 = call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %19)
  %21 = icmp slt i32 %18, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %61

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %24 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 13
  %25 = load i32, ptr %3, align 4, !tbaa !31
  %26 = sext i32 %25 to i64
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %24, i64 noundef %26)
  store ptr %27, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !31
  br label %28

28:                                               ; preds = %54, %23
  %29 = load i32, ptr %6, align 4, !tbaa !31
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  %32 = icmp ult i32 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %28
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %57

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !31
  %37 = zext i32 %36 to i64
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %35, i64 noundef %37)
  %39 = load i32, ptr %38, align 4, !tbaa !31
  %40 = lshr i32 %39, 1
  store i32 %40, ptr %7, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !31
  %43 = zext i32 %42 to i64
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %41, i64 noundef %43)
  %45 = load i32, ptr %44, align 4, !tbaa !31
  %46 = and i32 %45, 1
  store i32 %46, ptr %8, align 4, !tbaa !31
  %47 = load i32, ptr %3, align 4, !tbaa !31
  %48 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 18
  %49 = load i32, ptr %7, align 4, !tbaa !31
  %50 = zext i32 %49 to i64
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %48, i64 noundef %50)
  %52 = load i32, ptr %8, align 4, !tbaa !31
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %51, i32 noundef %52)
  store i32 %47, ptr %53, align 4, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %54

54:                                               ; preds = %34
  %55 = load i32, ptr %6, align 4, !tbaa !31
  %56 = add i32 %55, 1
  store i32 %56, ptr %6, align 4, !tbaa !31
  br label %28, !llvm.loop !32

57:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %3, align 4, !tbaa !31
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !31
  br label %17, !llvm.loop !34

61:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !31
  br label %62

62:                                               ; preds = %89, %61
  %63 = load i32, ptr %9, align 4, !tbaa !31
  %64 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !9
  %66 = icmp ult i32 %63, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %92

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %69 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 18
  %70 = load i32, ptr %9, align 4, !tbaa !31
  %71 = zext i32 %70 to i64
  %72 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %69, i64 noundef %71)
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %72, i32 noundef 0)
  %74 = load i32, ptr %73, align 4, !tbaa !31
  store i32 %74, ptr %10, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %75 = getelementptr inbounds %"class.basisu::basisu_frontend", ptr %12, i32 0, i32 18
  %76 = load i32, ptr %9, align 4, !tbaa !31
  %77 = zext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %75, i64 noundef %77)
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %78, i32 noundef 1)
  %80 = load i32, ptr %79, align 4, !tbaa !31
  store i32 %80, ptr %11, align 4, !tbaa !31
  br label %81

81:                                               ; preds = %68
  %82 = load i32, ptr %10, align 4, !tbaa !31
  %83 = load i32, ptr %11, align 4, !tbaa !31
  %84 = icmp eq i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 981)
  br label %86

86:                                               ; preds = %85, %81
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %9, align 4, !tbaa !31
  %91 = add i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !31
  br label %62, !llvm.loop !35

92:                                               ; preds = %67
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = { 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 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = distinct !{!34, !33}
!35 = distinct !{!35, !33}


; 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: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN6basisuL21handle_verify_failureEi(i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu15basisu_frontend32generate_block_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 296
  %3 = getelementptr inbounds i8, ptr %0, i64 88
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %5 = zext i32 %4 to i64
  tail call void @_ZN6basisu6vectorINS_5vec2UEE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %5, i1 noundef zeroext false)
  %6 = getelementptr inbounds i8, ptr %0, i64 216
  %7 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph24, label %.preheader

.preheader:                                       ; preds = %._crit_edge, %1
  %9 = load i32, ptr %3, align 8, !tbaa !5
  %.not28 = icmp eq i32 %9, 0
  br i1 %.not28, label %._crit_edge27, label %.lr.ph26

.lr.ph24:                                         ; preds = %1, %._crit_edge
  %indvars.iv30 = phi i64 [ %indvars.iv.next31, %._crit_edge ], [ 0, %1 ]
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IjEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 noundef %indvars.iv30)
  %11 = tail call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph24
  %12 = trunc nuw nsw i64 %indvars.iv30 to i32
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph24
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %13 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IjEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next31, %14
  br i1 %15, label %.lr.ph24, label %.preheader, !llvm.loop !30

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %16 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv)
  %17 = load i32, ptr %16, align 4, !tbaa !32
  %18 = lshr i32 %17, 1
  %19 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv)
  %20 = load i32, ptr %19, align 4, !tbaa !32
  %21 = and i32 %20, 1
  %22 = zext nneg i32 %18 to i64
  %23 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %22)
  %24 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %23, i32 noundef %21)
  store i32 %12, ptr %24, align 4, !tbaa !32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = tail call noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %26 = zext i32 %25 to i64
  %27 = icmp ult i64 %indvars.iv.next, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !33

._crit_edge27:                                    ; preds = %36, %.preheader
  ret void

.lr.ph26:                                         ; preds = %.preheader, %36
  %indvars.iv33 = phi i64 [ %indvars.iv.next34, %36 ], [ 0, %.preheader ]
  %28 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv33)
  %29 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %28, i32 noundef 0)
  %30 = load i32, ptr %29, align 4, !tbaa !32
  %31 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %indvars.iv33)
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8) %31, i32 noundef 1)
  %33 = load i32, ptr %32, align 4, !tbaa !32
  %34 = icmp eq i32 %30, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %.lr.ph26
  tail call void @_ZN6basisuL21handle_verify_failureEi(i32 noundef 981)
  br label %36

36:                                               ; preds = %35, %.lr.ph26
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %37 = load i32, ptr %3, align 8, !tbaa !5
  %38 = zext i32 %37 to i64
  %39 = icmp ult i64 %indvars.iv.next34, %38
  br i1 %39, label %.lr.ph26, label %._crit_edge27, !llvm.loop !34
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN6basisu6vectorINS_5vec2UEEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu5vec2UixEj(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorIjE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #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 = { 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 #3 = { 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" }

!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 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!8, !8, i64 0}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}


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