; LLVM IR from ggml-org/ggml :: src (ggml-alloc)

; 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.ggml_tensor = type { i32, ptr, [4 x i64], [4 x i64], i32, [16 x i32], i32, [10 x ptr], ptr, i64, ptr, [64 x i8], ptr, [8 x i8] }

@.str.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [54 x i8], align 1
@__func__.ggml_backend_alloc_ctx_tensors_from_buft = external hidden unnamed_addr constant [41 x i8], align 1

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

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

declare void @ggml_log_internal(i32 noundef, ptr noundef, ...) #1

; Function Attrs: noreturn
declare void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) #2

declare i64 @ggml_backend_buft_get_alignment(ptr noundef) #1

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

declare i64 @ggml_backend_buft_get_alloc_size(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @ggml_backend_alloc_ctx_tensors_from_buft(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call zeroext i1 @ggml_get_no_alloc(ptr noundef %16)
  %18 = zext i1 %17 to i32
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %21, label %20

20:                                               ; preds = %2
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.1, i32 noundef 988, ptr noundef @.str.5, ptr noundef @.str.19) #5
  unreachable

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = call i64 @ggml_backend_buft_get_alignment(ptr noundef %22)
  store i64 %23, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = call i64 @ggml_backend_buft_get_max_size(ptr noundef %24)
  store i64 %25, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = call ptr @ggml_get_first_tensor(ptr noundef %26)
  store ptr %27, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %28, ptr %12, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %82, %21
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %13, align 4
  br label %86

33:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !9
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ggml_tensor, ptr %34, i32 0, i32 10
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %54

38:                                               ; preds = %33
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ggml_tensor, ptr %39, i32 0, i32 8
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %54

43:                                               ; preds = %38
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = call i64 @ggml_backend_buft_get_alloc_size(ptr noundef %44, ptr noundef %45)
  %47 = load i64, ptr %6, align 8, !tbaa !9
  %48 = add i64 %46, %47
  %49 = sub i64 %48, 1
  %50 = load i64, ptr %6, align 8, !tbaa !9
  %51 = sub i64 %50, 1
  %52 = xor i64 %51, -1
  %53 = and i64 %49, %52
  store i64 %53, ptr %14, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %43, %38, %33
  %55 = load i64, ptr %10, align 8, !tbaa !9
  %56 = icmp ugt i64 %55, 0
  br i1 %56, label %57, label %74

57:                                               ; preds = %54
  %58 = load i64, ptr %10, align 8, !tbaa !9
  %59 = load i64, ptr %14, align 8, !tbaa !9
  %60 = add i64 %58, %59
  %61 = load i64, ptr %7, align 8, !tbaa !9
  %62 = icmp ugt i64 %60, %61
  br i1 %62, label %63, label %74

63:                                               ; preds = %57
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load i64, ptr %10, align 8, !tbaa !9
  %69 = call zeroext i1 @alloc_tensor_range(ptr noundef %64, ptr noundef %65, ptr noundef %66, ptr noundef %67, i64 noundef %68, ptr noundef %8, ptr noundef %9)
  br i1 %69, label %71, label %70

70:                                               ; preds = %63
  store ptr null, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %79

71:                                               ; preds = %63
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %72, ptr %11, align 8, !tbaa !5
  %73 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %73, ptr %10, align 8, !tbaa !9
  br label %78

74:                                               ; preds = %57, %54
  %75 = load i64, ptr %14, align 8, !tbaa !9
  %76 = load i64, ptr %10, align 8, !tbaa !9
  %77 = add i64 %76, %75
  store i64 %77, ptr %10, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %74, %71
  store i32 0, ptr %13, align 4
  br label %79

79:                                               ; preds = %78, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %80 = load i32, ptr %13, align 4
  switch i32 %80, label %86 [
    i32 0, label %81
  ]

81:                                               ; preds = %79
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = call ptr @ggml_get_next_tensor(ptr noundef %83, ptr noundef %84)
  store ptr %85, ptr %12, align 8, !tbaa !5
  br label %29, !llvm.loop !15

86:                                               ; preds = %79, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %87 = load i32, ptr %13, align 4
  switch i32 %87, label %117 [
    i32 2, label %88
  ]

88:                                               ; preds = %86
  %89 = load i64, ptr %10, align 8, !tbaa !9
  %90 = icmp ugt i64 %89, 0
  br i1 %90, label %91, label %99

91:                                               ; preds = %88
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i64, ptr %10, align 8, !tbaa !9
  %96 = call zeroext i1 @alloc_tensor_range(ptr noundef %92, ptr noundef %93, ptr noundef null, ptr noundef %94, i64 noundef %95, ptr noundef %8, ptr noundef %9)
  br i1 %96, label %98, label %97

97:                                               ; preds = %91
  store ptr null, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %117

98:                                               ; preds = %91
  br label %99

99:                                               ; preds = %98, %88
  %100 = load i64, ptr %9, align 8, !tbaa !9
  %101 = icmp eq i64 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  call void (i32, ptr, ...) @ggml_log_internal(i32 noundef 1, ptr noundef @.str.20, ptr noundef @__func__.ggml_backend_alloc_ctx_tensors_from_buft)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %13, align 4
  br label %117

103:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %104 = load i64, ptr %9, align 8, !tbaa !9
  %105 = icmp eq i64 %104, 1
  br i1 %105, label %106, label %110

106:                                              ; preds = %103
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds ptr, ptr %107, i64 0
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  store ptr %109, ptr %15, align 8, !tbaa !5
  br label %114

110:                                              ; preds = %103
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = load i64, ptr %9, align 8, !tbaa !9
  %113 = call ptr @ggml_backend_multi_buffer_alloc_buffer(ptr noundef %111, i64 noundef %112)
  store ptr %113, ptr %15, align 8, !tbaa !5
  br label %114

114:                                              ; preds = %110, %106
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %115) #6
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %116, ptr %3, align 8
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %117

117:                                              ; preds = %114, %102, %97, %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %118 = load ptr, ptr %3, align 8
  ret ptr %118
}

declare zeroext i1 @ggml_get_no_alloc(ptr noundef) #1

declare i64 @ggml_backend_buft_get_max_size(ptr noundef) #1

declare ptr @ggml_get_first_tensor(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @alloc_tensor_range(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #4

declare ptr @ggml_get_next_tensor(ptr noundef, ptr noundef) #1

declare ptr @ggml_backend_multi_buffer_alloc_buffer(ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn "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 = { 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 #4 = { 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 = { noreturn }
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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 248}
!12 = !{!"ggml_tensor", !13, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !13, i64 80, !7, i64 84, !13, i64 148, !7, i64 152, !6, i64 232, !10, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 232}
!15 = distinct !{!15, !16}
!16 = !{!"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.1 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [54 x i8], align 1
@__func__.ggml_backend_alloc_ctx_tensors_from_buft = external hidden unnamed_addr constant [41 x i8], align 1

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

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

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

; Function Attrs: noreturn
declare void @ggml_abort(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare i64 @ggml_backend_buft_get_alignment(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @ggml_backend_alloc_ctx_tensors_from_buft(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = tail call zeroext i1 @ggml_get_no_alloc(ptr noundef %0) #5
  br i1 %5, label %7, label %6

6:                                                ; preds = %2
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.1, i32 noundef 988, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.19) #6
  unreachable

7:                                                ; preds = %2
  %8 = tail call i64 @ggml_backend_buft_get_alignment(ptr noundef %1) #5
  %9 = tail call i64 @ggml_backend_buft_get_max_size(ptr noundef %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store i64 0, ptr %4, align 8, !tbaa !9
  %10 = tail call ptr @ggml_get_first_tensor(ptr noundef %0) #5
  %.not65 = icmp eq ptr %10, null
  br i1 %.not65, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %11 = add i64 %8, -1
  %12 = sub i64 0, %8
  br label %13

13:                                               ; preds = %.lr.ph, %30
  %.03868 = phi ptr [ %10, %.lr.ph ], [ %31, %30 ]
  %.03967 = phi ptr [ %10, %.lr.ph ], [ %.2.ph, %30 ]
  %.04166 = phi i64 [ 0, %.lr.ph ], [ %.243.ph, %30 ]
  %14 = getelementptr inbounds i8, ptr %.03868, i64 248
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %25

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %.03868, i64 232
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %25

21:                                               ; preds = %17
  %22 = call i64 @ggml_backend_buft_get_alloc_size(ptr noundef %1, ptr noundef nonnull %.03868) #5
  %23 = add i64 %11, %22
  %24 = and i64 %23, %12
  br label %25

25:                                               ; preds = %21, %17, %13
  %.036 = phi i64 [ %24, %21 ], [ 0, %17 ], [ 0, %13 ]
  %.not50 = icmp ne i64 %.04166, 0
  %26 = add i64 %.036, %.04166
  %27 = icmp ugt i64 %26, %9
  %or.cond = select i1 %.not50, i1 %27, i1 false
  br i1 %or.cond, label %28, label %30

28:                                               ; preds = %25
  %29 = call zeroext i1 @alloc_tensor_range(ptr noundef %0, ptr noundef %.03967, ptr noundef nonnull %.03868, ptr noundef %1, i64 noundef %.04166, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br i1 %29, label %30, label %.loopexit

30:                                               ; preds = %28, %25
  %.243.ph = phi i64 [ %26, %25 ], [ %.036, %28 ]
  %.2.ph = phi ptr [ %.03967, %25 ], [ %.03868, %28 ]
  %31 = call ptr @ggml_get_next_tensor(ptr noundef %0, ptr noundef nonnull %.03868) #5
  %.not = icmp eq ptr %31, null
  br i1 %.not, label %._crit_edge, label %13, !llvm.loop !15

._crit_edge:                                      ; preds = %30
  %.not51 = icmp eq i64 %.243.ph, 0
  br i1 %.not51, label %34, label %32

32:                                               ; preds = %._crit_edge
  %33 = call zeroext i1 @alloc_tensor_range(ptr noundef %0, ptr noundef %.2.ph, ptr noundef null, ptr noundef %1, i64 noundef %.243.ph, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br i1 %33, label %34, label %.loopexit

34:                                               ; preds = %32, %._crit_edge
  %.pr = load i64, ptr %4, align 8, !tbaa !9
  switch i64 %.pr, label %38 [
    i64 0, label %.thread
    i64 1, label %35
  ]

.thread:                                          ; preds = %7, %34
  call void (i32, ptr, ...) @ggml_log_internal(i32 noundef 1, ptr noundef nonnull @.str.20, ptr noundef nonnull @__func__.ggml_backend_alloc_ctx_tensors_from_buft) #5
  br label %.loopexit

35:                                               ; preds = %34
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  br label %41

38:                                               ; preds = %34
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = call ptr @ggml_backend_multi_buffer_alloc_buffer(ptr noundef %39, i64 noundef %.pr) #5
  %.pre = load ptr, ptr %3, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %38, %35
  %42 = phi ptr [ %36, %35 ], [ %.pre, %38 ]
  %.0 = phi ptr [ %37, %35 ], [ %40, %38 ]
  call void @free(ptr noundef %42) #5
  br label %.loopexit

.loopexit:                                        ; preds = %28, %32, %41, %.thread
  %.348 = phi ptr [ null, %.thread ], [ %.0, %41 ], [ null, %32 ], [ null, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret ptr %.348
}

declare zeroext i1 @ggml_get_no_alloc(ptr noundef) local_unnamed_addr #1

declare i64 @ggml_backend_buft_get_max_size(ptr noundef) local_unnamed_addr #1

declare ptr @ggml_get_first_tensor(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @alloc_tensor_range(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @ggml_get_next_tensor(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn "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 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 #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 248}
!12 = !{!"ggml_tensor", !13, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !13, i64 80, !7, i64 84, !13, i64 148, !7, i64 152, !6, i64 232, !10, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !6, i64 232}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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