; LLVM IR from AmplitudeAudio/sdk :: src/Utils/SmMalloc/smmalloc.ll (ZN2sm9Allocator4InitEjm)

; 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.sm::Allocator" = type { i64, i64, ptr, %"struct.std::array", [56 x i8], %"struct.std::array.0", %"class.std::unique_ptr", ptr, [40 x i8] }
%"struct.std::array" = type { [62 x ptr] }
%"struct.std::array.0" = type { [62 x %"struct.sm::Allocator::PoolBucket"] }
%"struct.sm::Allocator::PoolBucket" = type <{ %"struct.std::atomic", ptr, ptr, %"struct.std::atomic.1", [36 x i8] }>
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i64 }
%"struct.std::atomic.1" = type { %"struct.std::__atomic_base.2" }
%"struct.std::__atomic_base.2" = type { i32 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.3", %"struct.std::_Head_base.4" }
%"struct.std::_Tuple_impl.3" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { %"struct.sm::GenericAllocator::Deleter" }
%"struct.sm::GenericAllocator::Deleter" = type { ptr }
%"struct.std::_Head_base.4" = type { ptr }

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2sm27GetBucketSizeInBytesByIndexEm(i64 noundef) #1

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

declare noundef ptr @_ZN2sm16GenericAllocator5AllocEPvmm(ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2sm9Allocator10PoolBucket6CreateEm(ptr noundef nonnull align 64 dereferenceable(28), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2sm9Allocator4InitEjm(ptr noundef nonnull align 64 dereferenceable(4568) %0, i32 noundef %1, i64 noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i64 %2, ptr %6, align 8, !tbaa !11
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 0
  %14 = load i64, ptr %13, align 64, !tbaa !13
  %15 = icmp ugt i64 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %3
  br label %102

17:                                               ; preds = %3
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  br label %102

21:                                               ; preds = %17
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = icmp uge i32 %22, 62
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store i32 62, ptr %5, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %24, %21
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 0
  store i64 %27, ptr %28, align 64, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 4096, ptr %7, align 8, !tbaa !11
  %29 = load i64, ptr %6, align 8, !tbaa !11
  %30 = call noundef i64 @_ZN2sm5AlignEmm(i64 noundef %29, i64 noundef 4096)
  %31 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 1
  store i64 %30, ptr %31, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !11
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %32

32:                                               ; preds = %41, %25
  %33 = load i64, ptr %8, align 8, !tbaa !11
  %34 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 3
  %35 = call noundef i64 @_ZNKSt5arrayIPhLm62EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(496) %34) #7
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %37, label %44

37:                                               ; preds = %32
  %38 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 3
  %39 = load i64, ptr %8, align 8, !tbaa !11
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496) %38, i64 noundef %39) #6
  store ptr null, ptr %40, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %37
  %42 = load i64, ptr %8, align 8, !tbaa !11
  %43 = add i64 %42, 1
  store i64 %43, ptr %8, align 8, !tbaa !11
  br label %32, !llvm.loop !27

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %45 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 1
  %46 = load i64, ptr %45, align 8, !tbaa !26
  %47 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 0
  %48 = load i64, ptr %47, align 64, !tbaa !13
  %49 = mul i64 %46, %48
  store i64 %49, ptr %9, align 8, !tbaa !11
  %50 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 6
  %51 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 7
  %52 = load ptr, ptr %51, align 16, !tbaa !29
  %53 = load i64, ptr %9, align 8, !tbaa !11
  %54 = load i64, ptr %7, align 8, !tbaa !11
  %55 = call noundef ptr @_ZN2sm16GenericAllocator5AllocEPvmm(ptr noundef %52, i64 noundef %53, i64 noundef %54)
  call void @_ZNSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE5resetEPh(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef %55) #6
  %56 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 6
  %57 = call noundef ptr @_ZNKSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %56) #6
  %58 = load i64, ptr %9, align 8, !tbaa !11
  %59 = getelementptr inbounds i8, ptr %57, i64 %58
  %60 = getelementptr inbounds i8, ptr %59, i64 1
  %61 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 2
  store ptr %60, ptr %61, align 16, !tbaa !30
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %98, %44
  %63 = load i64, ptr %8, align 8, !tbaa !11
  %64 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 0
  %65 = load i64, ptr %64, align 64, !tbaa !13
  %66 = icmp ult i64 %63, %65
  br i1 %66, label %67, label %101

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %68 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 5
  %69 = load i64, ptr %8, align 8, !tbaa !11
  %70 = call noundef nonnull align 64 dereferenceable(28) ptr @_ZNSt5arrayIN2sm9Allocator10PoolBucketELm62EEixEm(ptr noundef nonnull align 64 dereferenceable(3968) %68, i64 noundef %69) #6
  store ptr %70, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 6
  %72 = call noundef ptr @_ZNKSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %71) #6
  %73 = load i64, ptr %8, align 8, !tbaa !11
  %74 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 1
  %75 = load i64, ptr %74, align 8, !tbaa !26
  %76 = mul i64 %73, %75
  %77 = getelementptr inbounds i8, ptr %72, i64 %76
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.sm::Allocator::PoolBucket", ptr %78, i32 0, i32 1
  store ptr %77, ptr %79, align 8, !tbaa !31
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.sm::Allocator::PoolBucket", ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !31
  %83 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 1
  %84 = load i64, ptr %83, align 8, !tbaa !26
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.sm::Allocator::PoolBucket", ptr %86, i32 0, i32 2
  store ptr %85, ptr %87, align 16, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %88 = load i64, ptr %8, align 8, !tbaa !11
  %89 = call noundef i64 @_ZN2sm27GetBucketSizeInBytesByIndexEm(i64 noundef %88)
  store i64 %89, ptr %11, align 8, !tbaa !11
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load i64, ptr %11, align 8, !tbaa !11
  call void @_ZN2sm9Allocator10PoolBucket6CreateEm(ptr noundef nonnull align 64 dereferenceable(28) %90, i64 noundef %91)
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.sm::Allocator::PoolBucket", ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !31
  %95 = getelementptr inbounds %"class.sm::Allocator", ptr %12, i32 0, i32 3
  %96 = load i64, ptr %8, align 8, !tbaa !11
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496) %95, i64 noundef %96) #6
  store ptr %94, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %98

98:                                               ; preds = %67
  %99 = load i64, ptr %8, align 8, !tbaa !11
  %100 = add i64 %99, 1
  store i64 %100, ptr %8, align 8, !tbaa !11
  br label %62, !llvm.loop !38

101:                                              ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %102

102:                                              ; preds = %101, %20, %16
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2sm5AlignEmm(i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind willreturn memory(none) uwtable
declare dso_local noundef i64 @_ZNKSt5arrayIPhLm62EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(496)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496), i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE5resetEPh(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 64 dereferenceable(28) ptr @_ZNSt5arrayIN2sm9Allocator10PoolBucketELm62EEixEm(ptr noundef nonnull align 64 dereferenceable(3968), i64 noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline 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 = { "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 = { 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 #5 = { mustprogress nounwind willreturn memory(none) 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 }
attributes #7 = { nounwind willreturn memory(none) }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTSN2sm9AllocatorE", !12, i64 0, !12, i64 8, !6, i64 16, !15, i64 24, !16, i64 576, !17, i64 4544, !6, i64 4560}
!15 = !{!"_ZTSSt5arrayIPhLm62EE", !7, i64 0}
!16 = !{!"_ZTSSt5arrayIN2sm9Allocator10PoolBucketELm62EE", !7, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIhN2sm16GenericAllocator7DeleterELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIhN2sm16GenericAllocator7DeleterEE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPhN2sm16GenericAllocator7DeleterEEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPhN2sm16GenericAllocator7DeleterEEE", !22, i64 0, !25, i64 8}
!22 = !{!"_ZTSSt11_Tuple_implILm1EJN2sm16GenericAllocator7DeleterEEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm1EN2sm16GenericAllocator7DeleterELb0EE", !24, i64 0}
!24 = !{!"_ZTSN2sm16GenericAllocator7DeleterE", !6, i64 0}
!25 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !6, i64 0}
!26 = !{!14, !12, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!14, !6, i64 4560}
!30 = !{!14, !6, i64 16}
!31 = !{!32, !6, i64 8}
!32 = !{!"_ZTSN2sm9Allocator10PoolBucketE", !33, i64 0, !6, i64 8, !6, i64 16, !35, i64 24}
!33 = !{!"_ZTSSt6atomicImE", !34, i64 0}
!34 = !{!"_ZTSSt13__atomic_baseImE", !12, i64 0}
!35 = !{!"_ZTSSt6atomicIjE", !36, i64 0}
!36 = !{!"_ZTSSt13__atomic_baseIjE", !10, i64 0}
!37 = !{!32, !6, i64 16}
!38 = distinct !{!38, !28}


; 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: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2sm27GetBucketSizeInBytesByIndexEm(i64 noundef) local_unnamed_addr #0

declare noundef ptr @_ZN2sm16GenericAllocator5AllocEPvmm(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2sm9Allocator10PoolBucket6CreateEm(ptr noundef nonnull align 64 dereferenceable(28), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2sm9Allocator4InitEjm(ptr noundef nonnull align 64 dereferenceable(4568) %0, i32 noundef %1, i64 noundef %2) local_unnamed_addr #3 align 2 {
  %4 = load i64, ptr %0, align 64, !tbaa !5
  %5 = icmp ne i64 %4, 0
  %6 = icmp eq i32 %1, 0
  %or.cond = or i1 %6, %5
  br i1 %or.cond, label %.loopexit, label %7

7:                                                ; preds = %3
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %1, i32 62)
  %8 = zext nneg i32 %spec.store.select to i64
  store i64 %8, ptr %0, align 64, !tbaa !5
  %9 = tail call noundef i64 @_ZN2sm5AlignEmm(i64 noundef %2, i64 noundef 4096)
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %9, ptr %10, align 8, !tbaa !22
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = tail call noundef i64 @_ZNKSt5arrayIPhLm62EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(496) %11) #6
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7, %.lr.ph
  %.024 = phi i64 [ %14, %.lr.ph ], [ 0, %7 ]
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496) %11, i64 noundef %.024) #7
  store ptr null, ptr %13, align 8, !tbaa !23
  %14 = add nuw i64 %.024, 1
  %exitcond.not = icmp eq i64 %14, %12
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !24

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i64, ptr %10, align 8, !tbaa !22
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %7
  %15 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %9, %7 ]
  %16 = load i64, ptr %0, align 64, !tbaa !5
  %17 = mul i64 %16, %15
  %18 = getelementptr inbounds i8, ptr %0, i64 4544
  %19 = getelementptr inbounds i8, ptr %0, i64 4560
  %20 = load ptr, ptr %19, align 16, !tbaa !26
  %21 = tail call noundef ptr @_ZN2sm16GenericAllocator5AllocEPvmm(ptr noundef %20, i64 noundef %17, i64 noundef 4096)
  tail call void @_ZNSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE5resetEPh(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef %21) #7
  %22 = tail call noundef ptr @_ZNKSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #7
  %23 = getelementptr inbounds i8, ptr %22, i64 %17
  %24 = getelementptr inbounds i8, ptr %23, i64 1
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %24, ptr %25, align 16, !tbaa !27
  %26 = load i64, ptr %0, align 64, !tbaa !5
  %.not28 = icmp eq i64 %26, 0
  br i1 %.not28, label %.loopexit, label %.lr.ph27

.lr.ph27:                                         ; preds = %._crit_edge
  %27 = getelementptr inbounds i8, ptr %0, i64 576
  br label %28

28:                                               ; preds = %.lr.ph27, %28
  %.125 = phi i64 [ 0, %.lr.ph27 ], [ %40, %28 ]
  %29 = tail call noundef nonnull align 64 dereferenceable(28) ptr @_ZNSt5arrayIN2sm9Allocator10PoolBucketELm62EEixEm(ptr noundef nonnull align 64 dereferenceable(3968) %27, i64 noundef %.125) #7
  %30 = tail call noundef ptr @_ZNKSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE3getEv(ptr noundef nonnull align 8 dereferenceable(16) %18) #7
  %31 = load i64, ptr %10, align 8, !tbaa !22
  %32 = mul i64 %31, %.125
  %33 = getelementptr inbounds i8, ptr %30, i64 %32
  %34 = getelementptr inbounds i8, ptr %29, i64 8
  store ptr %33, ptr %34, align 8, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %33, i64 %31
  %36 = getelementptr inbounds i8, ptr %29, i64 16
  store ptr %35, ptr %36, align 16, !tbaa !35
  %37 = tail call noundef i64 @_ZN2sm27GetBucketSizeInBytesByIndexEm(i64 noundef %.125)
  tail call void @_ZN2sm9Allocator10PoolBucket6CreateEm(ptr noundef nonnull align 64 dereferenceable(28) %29, i64 noundef %37)
  %38 = load ptr, ptr %34, align 8, !tbaa !28
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496) %11, i64 noundef %.125) #7
  store ptr %38, ptr %39, align 8, !tbaa !23
  %40 = add nuw i64 %.125, 1
  %41 = load i64, ptr %0, align 64, !tbaa !5
  %42 = icmp ult i64 %40, %41
  br i1 %42, label %28, label %.loopexit, !llvm.loop !36

.loopexit:                                        ; preds = %28, %._crit_edge, %3
  ret void
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN2sm5AlignEmm(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
declare dso_local noundef i64 @_ZNKSt5arrayIPhLm62EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(496)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5arrayIPhLm62EEixEm(ptr noundef nonnull align 8 dereferenceable(496), i64 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 64 dereferenceable(28) ptr @_ZNSt5arrayIN2sm9Allocator10PoolBucketELm62EEixEm(ptr noundef nonnull align 64 dereferenceable(3968), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5

attributes #0 = { alwaysinline 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 = { "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 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 #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 nofree nosync nounwind willreturn memory(none) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"_ZTSN2sm9AllocatorE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 24, !12, i64 576, !13, i64 4544, !10, i64 4560}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSSt5arrayIPhLm62EE", !8, i64 0}
!12 = !{!"_ZTSSt5arrayIN2sm9Allocator10PoolBucketELm62EE", !8, i64 0}
!13 = !{!"_ZTSSt10unique_ptrIhN2sm16GenericAllocator7DeleterEE", !14, i64 0}
!14 = !{!"_ZTSSt15__uniq_ptr_dataIhN2sm16GenericAllocator7DeleterELb1ELb1EE", !15, i64 0}
!15 = !{!"_ZTSSt15__uniq_ptr_implIhN2sm16GenericAllocator7DeleterEE", !16, i64 0}
!16 = !{!"_ZTSSt5tupleIJPhN2sm16GenericAllocator7DeleterEEE", !17, i64 0}
!17 = !{!"_ZTSSt11_Tuple_implILm0EJPhN2sm16GenericAllocator7DeleterEEE", !18, i64 0, !21, i64 8}
!18 = !{!"_ZTSSt11_Tuple_implILm1EJN2sm16GenericAllocator7DeleterEEE", !19, i64 0}
!19 = !{!"_ZTSSt10_Head_baseILm1EN2sm16GenericAllocator7DeleterELb0EE", !20, i64 0}
!20 = !{!"_ZTSN2sm16GenericAllocator7DeleterE", !10, i64 0}
!21 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !10, i64 0}
!22 = !{!6, !7, i64 8}
!23 = !{!10, !10, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !10, i64 4560}
!27 = !{!6, !10, i64 16}
!28 = !{!29, !10, i64 8}
!29 = !{!"_ZTSN2sm9Allocator10PoolBucketE", !30, i64 0, !10, i64 8, !10, i64 16, !32, i64 24}
!30 = !{!"_ZTSSt6atomicImE", !31, i64 0}
!31 = !{!"_ZTSSt13__atomic_baseImE", !7, i64 0}
!32 = !{!"_ZTSSt6atomicIjE", !33, i64 0}
!33 = !{!"_ZTSSt13__atomic_baseIjE", !34, i64 0}
!34 = !{!"int", !8, i64 0}
!35 = !{!29, !10, i64 16}
!36 = distinct !{!36, !25}


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