; LLVM IR from tsotchke/quantum_geometric_tensor :: src/quantum_geometric/core (memory_pool)

; 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"

%struct.ThreadCache = type { [64 x ptr], [64 x i64] }
%struct.MemoryPool = type { ptr, i64, ptr, i64, ptr, i64, i64, i64, %union.pthread_mutex_t, %struct.PoolConfig }
%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 }
%struct.PoolConfig = type { i64, i64, i64, float, i64, i8, i8, i64, i64, i8 }
%struct.SizeClass = type { i64, ptr, %union.pthread_mutex_t, i64, i64, i64, i64 }
%struct.Block = type { i64, i32, i8, i16, ptr, ptr, [40 x i8], ptr, [48 x i8] }
%struct.ThreadCacheEntry = type { ptr, i64, ptr }

@thread_cache_initialized = external hidden thread_local global i8, align 1
@thread_cache = external hidden thread_local global %struct.ThreadCache, align 8

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

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr 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: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @cleanup_memory_pool(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = icmp ne ptr %12, null
  br i1 %13, label %15, label %14

14:                                               ; preds = %1
  br label %120

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %49, %15
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = icmp slt i32 %17, 64
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %52

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.MemoryPool, ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = load i32, ptr %3, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds %struct.SizeClass, ptr %23, i64 %25
  store ptr %26, ptr %4, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.SizeClass, ptr %27, i32 0, i32 2
  %29 = call i32 @pthread_mutex_lock(ptr noundef %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.SizeClass, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  store ptr %32, ptr %5, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %36, %20
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %42

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.Block, ptr %37, i32 0, i32 4
  %39 = load ptr, ptr %38, align 16, !tbaa !19
  store ptr %39, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %40) #4
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %41, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %33, !llvm.loop !22

42:                                               ; preds = %33
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.SizeClass, ptr %43, i32 0, i32 2
  %45 = call i32 @pthread_mutex_unlock(ptr noundef %44) #4
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.SizeClass, ptr %46, i32 0, i32 2
  %48 = call i32 @pthread_mutex_destroy(ptr noundef %47) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  br label %49

49:                                               ; preds = %42
  %50 = load i32, ptr %3, align 4, !tbaa !9
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !9
  br label %16, !llvm.loop !24

52:                                               ; preds = %19
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.MemoryPool, ptr %53, i32 0, i32 8
  %55 = call i32 @pthread_mutex_lock(ptr noundef %54) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.MemoryPool, ptr %56, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  store ptr %58, ptr %7, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %62, %52
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %68

62:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Block, ptr %63, i32 0, i32 4
  %65 = load ptr, ptr %64, align 16, !tbaa !19
  store ptr %65, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %66) #4
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %67, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %59, !llvm.loop !26

68:                                               ; preds = %59
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MemoryPool, ptr %69, i32 0, i32 8
  %71 = call i32 @pthread_mutex_unlock(ptr noundef %70) #4
  %72 = call align 1 ptr @llvm.threadlocal.address.p0(ptr align 1 @thread_cache_initialized)
  %73 = load i8, ptr %72, align 1, !tbaa !27, !range !28, !noundef !29
  %74 = trunc i8 %73 to i1
  br i1 %74, label %75, label %112

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %107, %75
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = icmp slt i32 %77, 64
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %110

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %81 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @thread_cache)
  %82 = getelementptr inbounds %struct.ThreadCache, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [64 x ptr], ptr %82, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  store ptr %86, ptr %10, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %90, %80
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %96

90:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.ThreadCacheEntry, ptr %91, i32 0, i32 2
  %93 = load ptr, ptr %92, align 8, !tbaa !30
  store ptr %93, ptr %11, align 8, !tbaa !5
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %94) #4
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %95, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %87, !llvm.loop !32

96:                                               ; preds = %87
  %97 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @thread_cache)
  %98 = getelementptr inbounds %struct.ThreadCache, ptr %97, i32 0, i32 0
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [64 x ptr], ptr %98, i64 0, i64 %100
  store ptr null, ptr %101, align 8, !tbaa !5
  %102 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @thread_cache)
  %103 = getelementptr inbounds %struct.ThreadCache, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [64 x i64], ptr %103, i64 0, i64 %105
  store i64 0, ptr %106, align 8, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %107

107:                                              ; preds = %96
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !9
  br label %76, !llvm.loop !34

110:                                              ; preds = %79
  %111 = call align 1 ptr @llvm.threadlocal.address.p0(ptr align 1 @thread_cache_initialized)
  store i8 0, ptr %111, align 1, !tbaa !27
  br label %112

112:                                              ; preds = %110, %68
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MemoryPool, ptr %113, i32 0, i32 8
  %115 = call i32 @pthread_mutex_destroy(ptr noundef %114) #4
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.MemoryPool, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !11
  call void @free(ptr noundef %118) #4
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %119) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %120

120:                                              ; preds = %112, %14
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"MemoryPool", !6, i64 0, !13, i64 8, !6, i64 16, !13, i64 24, !6, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !14, i64 104}
!13 = !{!"long", !7, i64 0}
!14 = !{!"PoolConfig", !13, i64 0, !13, i64 8, !13, i64 16, !15, i64 24, !13, i64 32, !16, i64 40, !16, i64 41, !13, i64 48, !13, i64 56, !16, i64 64}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_Bool", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"SizeClass", !13, i64 0, !6, i64 8, !7, i64 16, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80}
!19 = !{!20, !6, i64 16}
!20 = !{!"Block", !13, i64 0, !10, i64 8, !16, i64 12, !21, i64 14, !6, i64 16, !6, i64 24, !7, i64 32, !6, i64 72}
!21 = !{!"short", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!12, !6, i64 32}
!26 = distinct !{!26, !23}
!27 = !{!16, !16, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!31, !6, i64 16}
!31 = !{!"ThreadCacheEntry", !6, i64 0, !13, i64 8, !6, i64 16}
!32 = distinct !{!32, !23}
!33 = !{!13, !13, i64 0}
!34 = distinct !{!34, !23}


; 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"

%struct.ThreadCache = type { [64 x ptr], [64 x i64] }
%struct.SizeClass = type { i64, ptr, %union.pthread_mutex_t, i64, i64, i64, i64 }
%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 }

@thread_cache_initialized = external hidden thread_local local_unnamed_addr global i8, align 1
@thread_cache = external hidden thread_local local_unnamed_addr global %struct.ThreadCache, align 8

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @cleanup_memory_pool(ptr noundef %0) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %37, label %.preheader39

.preheader39:                                     ; preds = %1
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  br label %8

3:                                                ; preds = %._crit_edge
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  %5 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %4) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not3643 = icmp eq ptr %7, null
  br i1 %.not3643, label %._crit_edge47, label %.lr.ph46

8:                                                ; preds = %.preheader39, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.preheader39 ], [ %indvars.iv.next, %._crit_edge ]
  %9 = load ptr, ptr %2, align 8, !tbaa !14
  %10 = getelementptr inbounds %struct.SizeClass, ptr %9, i64 %indvars.iv
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %11) #4
  %13 = getelementptr inbounds i8, ptr %10, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %.not3840 = icmp eq ptr %14, null
  br i1 %.not3840, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.03341 = phi ptr [ %16, %.lr.ph ], [ %14, %8 ]
  %15 = getelementptr inbounds i8, ptr %.03341, i64 16
  %16 = load ptr, ptr %15, align 16, !tbaa !17
  tail call void @free(ptr noundef nonnull %.03341) #4
  %.not38 = icmp eq ptr %16, null
  br i1 %.not38, label %._crit_edge, label %.lr.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph, %8
  %17 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %11) #4
  %18 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %11) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 64
  br i1 %exitcond.not, label %3, label %8, !llvm.loop !23

.lr.ph46:                                         ; preds = %3, %.lr.ph46
  %.03444 = phi ptr [ %20, %.lr.ph46 ], [ %7, %3 ]
  %19 = getelementptr inbounds i8, ptr %.03444, i64 16
  %20 = load ptr, ptr %19, align 16, !tbaa !17
  tail call void @free(ptr noundef nonnull %.03444) #4
  %.not36 = icmp eq ptr %20, null
  br i1 %.not36, label %._crit_edge47, label %.lr.ph46, !llvm.loop !24

._crit_edge47:                                    ; preds = %.lr.ph46, %3
  %21 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %4) #4
  %22 = tail call align 1 ptr @llvm.threadlocal.address.p0(ptr align 1 @thread_cache_initialized)
  %23 = load i8, ptr %22, align 1, !tbaa !25, !range !26, !noundef !27
  %24 = trunc nuw i8 %23 to i1
  br i1 %24, label %.preheader, label %34

.preheader:                                       ; preds = %._crit_edge47
  %25 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @thread_cache)
  %26 = getelementptr i8, ptr %25, i64 512
  br label %28

27:                                               ; preds = %._crit_edge52
  store i8 0, ptr %22, align 1, !tbaa !25
  br label %34

28:                                               ; preds = %.preheader, %._crit_edge52
  %indvars.iv55 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next56, %._crit_edge52 ]
  %29 = getelementptr inbounds [64 x ptr], ptr %25, i64 0, i64 %indvars.iv55
  %30 = load ptr, ptr %29, align 8, !tbaa !28
  %.not3748 = icmp eq ptr %30, null
  br i1 %.not3748, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %28, %.lr.ph51
  %.03149 = phi ptr [ %32, %.lr.ph51 ], [ %30, %28 ]
  %31 = getelementptr inbounds i8, ptr %.03149, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !29
  tail call void @free(ptr noundef nonnull %.03149) #4
  %.not37 = icmp eq ptr %32, null
  br i1 %.not37, label %._crit_edge52, label %.lr.ph51, !llvm.loop !31

._crit_edge52:                                    ; preds = %.lr.ph51, %28
  store ptr null, ptr %29, align 8, !tbaa !28
  %33 = getelementptr inbounds [64 x i64], ptr %26, i64 0, i64 %indvars.iv55
  store i64 0, ptr %33, align 8, !tbaa !32
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next56, 64
  br i1 %exitcond58.not, label %27, label %28, !llvm.loop !33

34:                                               ; preds = %27, %._crit_edge47
  %35 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %4) #4
  %36 = load ptr, ptr %2, align 8, !tbaa !14
  tail call void @free(ptr noundef %36) #4
  tail call void @free(ptr noundef %0) #4
  br label %37

37:                                               ; preds = %1, %34
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind "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 = { 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 32}
!6 = !{!"MemoryPool", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !11, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"PoolConfig", !10, i64 0, !10, i64 8, !10, i64 16, !12, i64 24, !10, i64 32, !13, i64 40, !13, i64 41, !10, i64 48, !10, i64 56, !13, i64 64}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!6, !7, i64 16}
!15 = !{!16, !7, i64 8}
!16 = !{!"SizeClass", !10, i64 0, !7, i64 8, !8, i64 16, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80}
!17 = !{!18, !7, i64 16}
!18 = !{!"Block", !10, i64 0, !19, i64 8, !13, i64 12, !20, i64 14, !7, i64 16, !7, i64 24, !8, i64 32, !7, i64 72}
!19 = !{!"int", !8, i64 0}
!20 = !{!"short", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = !{!13, !13, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!7, !7, i64 0}
!29 = !{!30, !7, i64 16}
!30 = !{!"ThreadCacheEntry", !7, i64 0, !10, i64 8, !7, i64 16}
!31 = distinct !{!31, !22}
!32 = !{!10, !10, i64 0}
!33 = distinct !{!33, !22}


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