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

; 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_frontend::params" = type { i32, ptr, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, i8, float, i32, ptr, ptr }

@.str.41 = external hidden unnamed_addr constant [34 x i8], align 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)) #0 align 2

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

; 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: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend23create_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend12encode_imageEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu14basisu_backend22get_total_input_texelsEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu14basisu_backend6encodeEv(ptr noundef nonnull align 8 dereferenceable(336) %0) #3 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  %7 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 2
  %8 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %9 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %8, i32 0, i32 8
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %7)
  %11 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 1
  %12 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %11, i32 0, i32 0
  %13 = load i8, ptr %12, align 8, !tbaa !9, !range !27, !noundef !28
  %14 = trunc i8 %13 to i1
  %15 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %16 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %15, i32 0, i32 1
  %17 = zext i1 %14 to i8
  store i8 %17, ptr %16, align 4, !tbaa !29
  %18 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 1
  %19 = getelementptr inbounds %"struct.basisu::basisu_backend_params", ptr %18, i32 0, i32 12
  %20 = load i8, ptr %19, align 1, !tbaa !30, !range !27, !noundef !28
  %21 = trunc i8 %20 to i1
  %22 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %23 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %22, i32 0, i32 2
  %24 = zext i1 %21 to i8
  store i8 %24, ptr %23, align 1, !tbaa !31
  %25 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !32
  %27 = call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %26)
  %28 = getelementptr inbounds %"struct.basisu::basisu_frontend::params", ptr %27, i32 0, i32 5
  %29 = load i8, ptr %28, align 4, !tbaa !33, !range !27, !noundef !28
  %30 = trunc i8 %29 to i1
  %31 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %32 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %31, i32 0, i32 3
  %33 = zext i1 %30 to i8
  store i8 %33, ptr %32, align 2, !tbaa !36
  call void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  call void @_ZN6basisu14basisu_backend23create_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  call void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  %34 = call noundef zeroext i1 @_ZN6basisu14basisu_backend12encode_imageEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  br i1 %34, label %36, label %35

35:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  br label %83

36:                                               ; preds = %1
  %37 = call noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  br i1 %37, label %39, label %38

38:                                               ; preds = %36
  store i32 0, ptr %2, align 4
  br label %83

39:                                               ; preds = %36
  %40 = call noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  br i1 %40, label %42, label %41

41:                                               ; preds = %39
  store i32 0, ptr %2, align 4
  br label %83

42:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %43 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %44 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %43, i32 0, i32 9
  %45 = call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %44)
  %46 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %47 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %46, i32 0, i32 6
  %48 = call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %47)
  %49 = add i32 %45, %48
  %50 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %51 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %50, i32 0, i32 7
  %52 = call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %51)
  %53 = add i32 %49, %52
  store i32 %53, ptr %4, align 4, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !37
  br label %54

54:                                               ; preds = %70, %42
  %55 = load i32, ptr %5, align 4, !tbaa !37
  %56 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %57 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %56, i32 0, i32 10
  %58 = call noundef i32 @_ZNK6basisu6vectorINS0_IhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %57)
  %59 = icmp ult i32 %55, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %54
  %62 = getelementptr inbounds %"class.basisu::basisu_backend", ptr %6, i32 0, i32 3
  %63 = getelementptr inbounds %"struct.basisu::basisu_backend_output", ptr %62, i32 0, i32 10
  %64 = load i32, ptr %5, align 4, !tbaa !37
  %65 = zext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IhEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %63, i64 noundef %65)
  %67 = call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %66)
  %68 = load i32, ptr %4, align 4, !tbaa !37
  %69 = add i32 %68, %67
  store i32 %69, ptr %4, align 4, !tbaa !37
  br label %70

70:                                               ; preds = %61
  %71 = load i32, ptr %5, align 4, !tbaa !37
  %72 = add i32 %71, 1
  store i32 %72, ptr %5, align 4, !tbaa !37
  br label %54, !llvm.loop !38

73:                                               ; preds = %60
  %74 = load i32, ptr %4, align 4, !tbaa !37
  %75 = load i32, ptr %4, align 4, !tbaa !37
  %76 = uitofp i32 %75 to float
  %77 = fmul float %76, 8.000000e+00
  %78 = call noundef i32 @_ZNK6basisu14basisu_backend22get_total_input_texelsEv(ptr noundef nonnull align 8 dereferenceable(336) %6)
  %79 = uitofp i32 %78 to float
  %80 = fdiv float %77, %79
  %81 = fpext float %80 to double
  call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef @.str.41, i32 noundef %74, double noundef %81)
  %82 = load i32, ptr %4, align 4, !tbaa !37
  store i32 %82, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %83

83:                                               ; preds = %73, %41, %38, %35
  %84 = load i32, ptr %2, align 4
  ret i32 %84
}

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

attributes #0 = { 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 #1 = { "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 = { 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 = { 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 #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 8}
!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 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!10, !12, i64 60}
!30 = !{!10, !12, i64 37}
!31 = !{!10, !12, i64 61}
!32 = !{!10, !6, i64 0}
!33 = !{!34, !12, i64 28}
!34 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !14, i64 0, !6, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !12, i64 28, !12, i64 29, !12, i64 30, !12, i64 31, !12, i64 32, !12, i64 33, !12, i64 34, !6, i64 40, !14, i64 48, !14, i64 52, !12, i64 56, !13, i64 60, !35, i64 64, !6, i64 72, !6, i64 80}
!35 = !{!"_ZTSN6basist18basis_texture_typeE", !7, i64 0}
!36 = !{!10, !12, i64 62}
!37 = !{!14, !14, i64 0}
!38 = distinct !{!38, !39}
!39 = !{!"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.41 = external hidden unnamed_addr constant [34 x i8], align 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 #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend23create_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend12encode_imageEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu14basisu_backend6encodeEv(ptr noundef nonnull align 8 dereferenceable(336) %0) local_unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 40
  %3 = getelementptr inbounds i8, ptr %0, i64 104
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS_25basisu_backend_slice_descEEaSERKS2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %2)
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !26, !noundef !27
  %7 = getelementptr inbounds i8, ptr %0, i64 60
  store i8 %6, ptr %7, align 4, !tbaa !28
  %8 = getelementptr inbounds i8, ptr %0, i64 37
  %9 = load i8, ptr %8, align 1, !tbaa !29, !range !26, !noundef !27
  %10 = getelementptr inbounds i8, ptr %0, i64 61
  store i8 %9, ptr %10, align 1, !tbaa !30
  %11 = load ptr, ptr %0, align 8, !tbaa !31
  %12 = tail call noundef nonnull align 8 dereferenceable(88) ptr @_ZNK6basisu15basisu_frontend10get_paramsEv(ptr noundef nonnull align 8 dereferenceable(496) %11)
  %13 = getelementptr inbounds i8, ptr %12, i64 28
  %14 = load i8, ptr %13, align 4, !tbaa !32, !range !26, !noundef !27
  %15 = getelementptr inbounds i8, ptr %0, i64 62
  store i8 %14, ptr %15, align 2, !tbaa !35
  tail call void @_ZN6basisu14basisu_backend23create_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  tail call void @_ZN6basisu14basisu_backend23create_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  tail call void @_ZN6basisu14basisu_backend21create_encoder_blocksEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  %16 = tail call noundef zeroext i1 @_ZN6basisu14basisu_backend12encode_imageEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  br i1 %16, label %17, label %44

17:                                               ; preds = %1
  %18 = tail call noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_endpoint_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  br i1 %18, label %19, label %44

19:                                               ; preds = %17
  %20 = tail call noundef zeroext i1 @_ZN6basisu14basisu_backend23encode_selector_paletteEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  br i1 %20, label %21, label %44

21:                                               ; preds = %19
  %22 = getelementptr inbounds i8, ptr %0, i64 120
  %23 = tail call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %22)
  %24 = getelementptr inbounds i8, ptr %0, i64 72
  %25 = tail call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %24)
  %26 = add i32 %25, %23
  %27 = getelementptr inbounds i8, ptr %0, i64 88
  %28 = tail call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %27)
  %29 = add i32 %26, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 136
  %31 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  %.not = icmp eq i32 %31, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %21
  %.08.lcssa = phi i32 [ %29, %21 ], [ %40, %.lr.ph ]
  %32 = uitofp i32 %.08.lcssa to float
  %33 = fmul float %32, 8.000000e+00
  %34 = tail call noundef i32 @_ZNK6basisu14basisu_backend22get_total_input_texelsEv(ptr noundef nonnull align 8 dereferenceable(336) %0)
  %35 = uitofp i32 %34 to float
  %36 = fdiv float %33, %35
  %37 = fpext float %36 to double
  tail call void (ptr, ...) @_ZN6basisu12debug_printfEPKcz(ptr noundef nonnull @.str.41, i32 noundef %.08.lcssa, double noundef %37)
  br label %44

.lr.ph:                                           ; preds = %21, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %21 ]
  %.0810 = phi i32 [ %40, %.lr.ph ], [ %29, %21 ]
  %38 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6basisu6vectorINS0_IhEEEixEm(ptr noundef nonnull align 8 dereferenceable(16) %30, i64 noundef %indvars.iv)
  %39 = tail call noundef i32 @_ZNK6basisu6vectorIhE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  %40 = add i32 %39, %.0810
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %41 = tail call noundef i32 @_ZNK6basisu6vectorINS0_IhEEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %30)
  %42 = zext i32 %41 to i64
  %43 = icmp ult i64 %indvars.iv.next, %42
  br i1 %43, label %.lr.ph, label %._crit_edge, !llvm.loop !36

44:                                               ; preds = %19, %17, %1, %._crit_edge
  %.09 = phi i32 [ %.08.lcssa, %._crit_edge ], [ 0, %1 ], [ 0, %17 ], [ 0, %19 ]
  ret i32 %.09
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 8}
!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 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!6, !11, i64 60}
!29 = !{!6, !11, i64 37}
!30 = !{!6, !11, i64 61}
!31 = !{!6, !7, i64 0}
!32 = !{!33, !11, i64 28}
!33 = !{!"_ZTSN6basisu15basisu_frontend6paramsE", !13, i64 0, !7, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !11, i64 28, !11, i64 29, !11, i64 30, !11, i64 31, !11, i64 32, !11, i64 33, !11, i64 34, !7, i64 40, !13, i64 48, !13, i64 52, !11, i64 56, !12, i64 60, !34, i64 64, !7, i64 72, !7, i64 80}
!34 = !{!"_ZTSN6basist18basis_texture_typeE", !8, i64 0}
!35 = !{!6, !11, i64 62}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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