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

; 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_backend" = type { ptr, %"struct.basisu::basisu_backend_params", %"class.basisu::vector", %"struct.basisu::basisu_backend_output", ptr, %"class.basisu::vector.6", %"class.basisu::vector.8", %"class.basisu::vector.10", %"class.basisu::vector.12", %"class.basisu::vector.14", %"class.basisu::vector.14", %"class.basisu::vector.16", %"class.basisu::vector.16", %"class.basisu::vector.14", %"class.basisu::vector.14" }
%"struct.basisu::basisu_backend_params" = type <{ i8, i8, i8, i8, float, float, i32, i8, [3 x i8], i32, i32, i8, i8, [2 x i8] }>
%"class.basisu::vector" = type { ptr, i32, i32 }
%"struct.basisu::basisu_backend_output" = type { i32, i8, i8, i8, i32, i32, %"class.basisu::vector.0", %"class.basisu::vector.0", %"class.basisu::vector", %"class.basisu::vector.0", %"class.basisu::vector.2", %"class.basisu::vector.4" }
%"class.basisu::vector.0" = type { ptr, i32, i32 }
%"class.basisu::vector.2" = type { ptr, i32, i32 }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::vector.6" = type { ptr, i32, i32 }
%"class.basisu::vector.8" = type { ptr, i32, i32 }
%"class.basisu::vector.10" = type { ptr, i32, i32 }
%"class.basisu::vector.12" = type { ptr, i32, i32 }
%"class.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::vector.14" = type { ptr, i32, i32 }
%"struct.basisu::basisu_backend_slice_desc" = type <{ i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, [2 x i8] }>

@.str = external hidden unnamed_addr constant [226 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [118 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend4initEPNS_15basisu_frontendERNS_21basisu_backend_paramsERKNS_6vectorINS_25basisu_backend_slice_descEEEPKN6basist29etc1_global_selector_codebookE(ptr noundef nonnull align 8 dereferenceable(336) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(30) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %4) #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %12 = load ptr, ptr %6, align 8
  %13 = load ptr, ptr %7, align 8, !tbaa !5
  %14 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 0
  store ptr %13, ptr %14, align 8, !tbaa !9
  %15 = load ptr, ptr %8, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 4 %15, i64 30, i1 false), !tbaa.struct !27
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %20 = load ptr, ptr %10, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 4
  store ptr %20, ptr %21, align 8, !tbaa !31
  %22 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %23 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %24, i32 0, i32 0
  %26 = load i8, ptr %25, align 4, !tbaa !32, !range !33, !noundef !34
  %27 = trunc i8 %26 to i1
  %28 = zext i1 %27 to i32
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %29, i32 0, i32 4
  %31 = load float, ptr %30, align 4, !tbaa !35
  %32 = fpext float %31 to double
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %33, i32 0, i32 5
  %35 = load float, ptr %34, align 4, !tbaa !36
  %36 = fpext float %35 to double
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %37, i32 0, i32 7
  %39 = load i8, ptr %38, align 4, !tbaa !37, !range !33, !noundef !34
  %40 = trunc i8 %39 to i1
  %41 = zext i1 %40 to i32
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %42, i32 0, i32 9
  %44 = load i32, ptr %43, align 4, !tbaa !38
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %45, i32 0, i32 10
  %47 = load i32, ptr %46, align 4, !tbaa !39
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %48, i32 0, i32 11
  %50 = load i8, ptr %49, align 4, !tbaa !40, !range !33, !noundef !34
  %51 = trunc i8 %50 to i1
  %52 = zext i1 %51 to i32
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str, i32 noundef %23, i32 noundef %28, double noundef %32, double noundef %36, i32 noundef %41, i32 noundef %44, i32 noundef %47, i32 noundef %52)
  %53 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %54)
  %56 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %57)
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.3, i32 noundef %55, i32 noundef %58)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !30
  br label %59

59:                                               ; preds = %109, %5
  %60 = load i32, ptr %11, align 4, !tbaa !30
  %61 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %62 = call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %61)
  %63 = icmp ult i32 %60, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %112

65:                                               ; preds = %59
  %66 = load i32, ptr %11, align 4, !tbaa !30
  %67 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %68 = load i32, ptr %11, align 4, !tbaa !30
  %69 = zext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %67, i64 noundef %69)
  %71 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !41
  %73 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %74 = load i32, ptr %11, align 4, !tbaa !30
  %75 = zext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %73, i64 noundef %75)
  %77 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %76, i32 0, i32 2
  %78 = load i32, ptr %77, align 4, !tbaa !43
  %79 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %80 = load i32, ptr %11, align 4, !tbaa !30
  %81 = zext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %79, i64 noundef %81)
  %83 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %82, i32 0, i32 3
  %84 = load i32, ptr %83, align 4, !tbaa !44
  %85 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %86 = load i32, ptr %11, align 4, !tbaa !30
  %87 = zext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %85, i64 noundef %87)
  %89 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %88, i32 0, i32 4
  %90 = load i32, ptr %89, align 4, !tbaa !45
  %91 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %92 = load i32, ptr %11, align 4, !tbaa !30
  %93 = zext i32 %92 to i64
  %94 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %91, i64 noundef %93)
  %95 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %94, i32 0, i32 5
  %96 = load i32, ptr %95, align 4, !tbaa !46
  %97 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %98 = load i32, ptr %11, align 4, !tbaa !30
  %99 = zext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %97, i64 noundef %99)
  %101 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %100, i32 0, i32 6
  %102 = load i32, ptr %101, align 4, !tbaa !47
  %103 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %12, i32 0, i32 2
  %104 = load i32, ptr %11, align 4, !tbaa !30
  %105 = zext i32 %104 to i64
  %106 = call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %103, i64 noundef %105)
  %107 = getelementptr inbounds %"struct.basisu::basisu_backend_slice_desc", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 4, !tbaa !48
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.4, i32 noundef %66, i32 noundef %72, i32 noundef %78, i32 noundef %84, i32 noundef %90, i32 noundef %96, i32 noundef %102, i32 noundef %108)
  br label %109

109:                                              ; preds = %65
  %110 = load i32, ptr %11, align 4, !tbaa !30
  %111 = add i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !30
  br label %59, !llvm.loop !49

112:                                              ; preds = %64
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496)) #5 align 2

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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, !6, i64 0}
!10 = !{!"_ZTSN6basisu14basisu_backendE", !6, i64 0, !11, i64 8, !15, i64 40, !16, i64 56, !6, i64 168, !21, i64 176, !22, i64 192, !23, i64 208, !24, i64 224, !25, i64 240, !25, i64 256, !26, i64 272, !26, i64 288, !25, i64 304, !25, i64 320}
!11 = !{!"_ZTSN6basisu21basisu_backend_paramsE", !12, i64 0, !12, i64 1, !12, i64 2, !13, i64 4, !13, i64 8, !14, i64 12, !12, i64 16, !14, i64 20, !14, i64 24, !12, i64 28, !12, i64 29}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN6basisu6vectorINS_25basisu_backend_slice_descEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!16 = !{!"_ZTSN6basisu21basisu_backend_outputE", !17, i64 0, !12, i64 4, !12, i64 5, !12, i64 6, !14, i64 8, !14, i64 12, !18, i64 16, !18, i64 32, !15, i64 48, !18, i64 64, !19, i64 80, !20, i64 96}
!17 = !{!"_ZTSN6basist16basis_tex_formatE", !7, i64 0}
!18 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !14, i64 8, !14, i64 12}
!19 = !{!"_ZTSN6basisu6vectorINS0_IhEEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!20 = !{!"_ZTSN6basisu6vectorItEE", !6, i64 0, !14, i64 8, !14, i64 12}
!21 = !{!"_ZTSN6basisu6vectorINS_27etc1_endpoint_palette_entryEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!22 = !{!"_ZTSN6basisu6vectorIN6basist27etc1_selector_palette_entryEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_14basisu_backend34etc1_global_selector_cb_entry_descEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!24 = !{!"_ZTSN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEE", !6, i64 0, !14, i64 8, !14, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !14, i64 8, !14, i64 12}
!26 = !{!"_ZTSN6basisu6vectorIbEE", !6, i64 0, !14, i64 8, !14, i64 12}
!27 = !{i64 0, i64 1, !28, i64 1, i64 1, !28, i64 2, i64 1, !28, i64 4, i64 4, !29, i64 8, i64 4, !29, i64 12, i64 4, !30, i64 16, i64 1, !28, i64 20, i64 4, !30, i64 24, i64 4, !30, i64 28, i64 1, !28, i64 29, i64 1, !28}
!28 = !{!12, !12, i64 0}
!29 = !{!13, !13, i64 0}
!30 = !{!14, !14, i64 0}
!31 = !{!10, !6, i64 168}
!32 = !{!11, !12, i64 0}
!33 = !{i8 0, i8 2}
!34 = !{}
!35 = !{!11, !13, i64 4}
!36 = !{!11, !13, i64 8}
!37 = !{!11, !12, i64 16}
!38 = !{!11, !14, i64 20}
!39 = !{!11, !14, i64 24}
!40 = !{!11, !12, i64 28}
!41 = !{!42, !14, i64 4}
!42 = !{!"_ZTSN6basisu25basisu_backend_slice_descE", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !12, i64 44, !12, i64 45}
!43 = !{!42, !14, i64 8}
!44 = !{!42, !14, i64 12}
!45 = !{!42, !14, i64 16}
!46 = !{!42, !14, i64 20}
!47 = !{!42, !14, i64 24}
!48 = !{!42, !14, i64 0}
!49 = distinct !{!49, !50}
!50 = !{!"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"

@.str = external hidden unnamed_addr constant [226 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [118 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14basisu_backend4initEPNS_15basisu_frontendERNS_21basisu_backend_paramsERKNS_6vectorINS_25basisu_backend_slice_descEEEPKN6basist29etc1_global_selector_codebookE(ptr noundef nonnull align 8 dereferenceable(336) %0, ptr noundef %1, ptr nocapture noundef nonnull readonly align 4 dereferenceable(30) %2, ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef %4) local_unnamed_addr #0 align 2 {
  store ptr %1, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(30) %6, ptr noundef nonnull align 4 dereferenceable(30) %2, i64 30, i1 false), !tbaa.struct !26
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %3)
  %9 = getelementptr inbounds i8, ptr %0, i64 168
  store ptr %4, ptr %9, align 8, !tbaa !30
  %10 = tail call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %11 = load i8, ptr %2, align 4, !tbaa !31, !range !32, !noundef !33
  %12 = zext nneg i8 %11 to i32
  %13 = getelementptr inbounds i8, ptr %2, i64 4
  %14 = load float, ptr %13, align 4, !tbaa !34
  %15 = fpext float %14 to double
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = load float, ptr %16, align 4, !tbaa !35
  %18 = fpext float %17 to double
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = load i8, ptr %19, align 4, !tbaa !36, !range !32, !noundef !33
  %21 = zext nneg i8 %20 to i32
  %22 = getelementptr inbounds i8, ptr %2, i64 20
  %23 = load i32, ptr %22, align 4, !tbaa !37
  %24 = getelementptr inbounds i8, ptr %2, i64 24
  %25 = load i32, ptr %24, align 4, !tbaa !38
  %26 = getelementptr inbounds i8, ptr %2, i64 28
  %27 = load i8, ptr %26, align 4, !tbaa !39, !range !32, !noundef !33
  %28 = zext nneg i8 %27 to i32
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str, i32 noundef %10, i32 noundef %12, double noundef %15, double noundef %18, i32 noundef %21, i32 noundef %23, i32 noundef %25, i32 noundef %28)
  %29 = load ptr, ptr %0, align 8, !tbaa !5
  %30 = tail call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %29)
  %31 = load ptr, ptr %0, align 8, !tbaa !5
  %32 = tail call noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496) %31)
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.3, i32 noundef %30, i32 noundef %32)
  %33 = tail call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %5
  ret void

.lr.ph:                                           ; preds = %5, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %5 ]
  %34 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %35 = getelementptr inbounds i8, ptr %34, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !40
  %37 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load i32, ptr %38, align 4, !tbaa !42
  %40 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %41 = getelementptr inbounds i8, ptr %40, i64 12
  %42 = load i32, ptr %41, align 4, !tbaa !43
  %43 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load i32, ptr %44, align 4, !tbaa !44
  %46 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %47 = getelementptr inbounds i8, ptr %46, i64 20
  %48 = load i32, ptr %47, align 4, !tbaa !45
  %49 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  %51 = load i32, ptr %50, align 4, !tbaa !46
  %52 = tail call noundef nonnull align 4 dereferenceable(46) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %7, i64 noundef %indvars.iv)
  %53 = load i32, ptr %52, align 4, !tbaa !47
  %54 = trunc nuw i64 %indvars.iv to i32
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.4, i32 noundef %54, i32 noundef %36, i32 noundef %39, i32 noundef %42, i32 noundef %45, i32 noundef %48, i32 noundef %51, i32 noundef %53)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = tail call noundef i32 @_ZNK6basisu6vectorINS_25basisu_backend_slice_descEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %56 = zext i32 %55 to i64
  %57 = icmp ult i64 %indvars.iv.next, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !48
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend27get_total_endpoint_clustersEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu15basisu_frontend27get_total_selector_clustersEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #5 align 2

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

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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { 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" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN6basisu14basisu_backendE", !7, i64 0, !10, i64 8, !14, i64 40, !15, i64 56, !7, i64 168, !20, i64 176, !21, i64 192, !22, i64 208, !23, i64 224, !24, i64 240, !24, i64 256, !25, i64 272, !25, i64 288, !24, i64 304, !24, i64 320}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6basisu21basisu_backend_paramsE", !11, i64 0, !11, i64 1, !11, i64 2, !12, i64 4, !12, i64 8, !13, i64 12, !11, i64 16, !13, i64 20, !13, i64 24, !11, i64 28, !11, i64 29}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN6basisu6vectorINS_25basisu_backend_slice_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!15 = !{!"_ZTSN6basisu21basisu_backend_outputE", !16, i64 0, !11, i64 4, !11, i64 5, !11, i64 6, !13, i64 8, !13, i64 12, !17, i64 16, !17, i64 32, !14, i64 48, !17, i64 64, !18, i64 80, !19, i64 96}
!16 = !{!"_ZTSN6basist16basis_tex_formatE", !8, i64 0}
!17 = !{!"_ZTSN6basisu6vectorIhEE", !7, i64 0, !13, i64 8, !13, i64 12}
!18 = !{!"_ZTSN6basisu6vectorINS0_IhEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!19 = !{!"_ZTSN6basisu6vectorItEE", !7, i64 0, !13, i64 8, !13, i64 12}
!20 = !{!"_ZTSN6basisu6vectorINS_27etc1_endpoint_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!21 = !{!"_ZTSN6basisu6vectorIN6basist27etc1_selector_palette_entryEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!22 = !{!"_ZTSN6basisu6vectorINS_14basisu_backend34etc1_global_selector_cb_entry_descEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!23 = !{!"_ZTSN6basisu6vectorINS_8vector2DINS_13encoder_blockEEEEE", !7, i64 0, !13, i64 8, !13, i64 12}
!24 = !{!"_ZTSN6basisu6vectorIjEE", !7, i64 0, !13, i64 8, !13, i64 12}
!25 = !{!"_ZTSN6basisu6vectorIbEE", !7, i64 0, !13, i64 8, !13, i64 12}
!26 = !{i64 0, i64 1, !27, i64 1, i64 1, !27, i64 2, i64 1, !27, i64 4, i64 4, !28, i64 8, i64 4, !28, i64 12, i64 4, !29, i64 16, i64 1, !27, i64 20, i64 4, !29, i64 24, i64 4, !29, i64 28, i64 1, !27, i64 29, i64 1, !27}
!27 = !{!11, !11, i64 0}
!28 = !{!12, !12, i64 0}
!29 = !{!13, !13, i64 0}
!30 = !{!6, !7, i64 168}
!31 = !{!10, !11, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!10, !12, i64 4}
!35 = !{!10, !12, i64 8}
!36 = !{!10, !11, i64 16}
!37 = !{!10, !13, i64 20}
!38 = !{!10, !13, i64 24}
!39 = !{!10, !11, i64 28}
!40 = !{!41, !13, i64 4}
!41 = !{!"_ZTSN6basisu25basisu_backend_slice_descE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !11, i64 44, !11, i64 45}
!42 = !{!41, !13, i64 8}
!43 = !{!41, !13, i64 12}
!44 = !{!41, !13, i64 16}
!45 = !{!41, !13, i64 20}
!46 = !{!41, !13, i64 24}
!47 = !{!41, !13, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


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