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

; 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_opt_dataset = type { ptr, ptr, ptr, ptr, i64, i64, i64, i64, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%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 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [70 x i8], align 1

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

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

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

declare i64 @ggml_nbytes(ptr noundef) #2

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

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

19:                                               ; preds = %4
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call zeroext i1 @ggml_is_contiguous(ptr noundef %20)
  br i1 %21, label %23, label %22

22:                                               ; preds = %19, %4
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 144, ptr noundef @.str.1, ptr noundef @.str.8) #5
  unreachable

23:                                               ; preds = %19
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %30

26:                                               ; preds = %23
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call zeroext i1 @ggml_is_contiguous(ptr noundef %27)
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 145, ptr noundef @.str.1, ptr noundef @.str.9) #5
  unreachable

30:                                               ; preds = %26, %23
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  %33 = zext i1 %32 to i32
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = icmp eq ptr %36, null
  %38 = zext i1 %37 to i32
  %39 = icmp eq i32 %33, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %30
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 146, ptr noundef @.str.1, ptr noundef @.str.10) #5
  unreachable

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = call i64 @ggml_nbytes(ptr noundef %42)
  store i64 %43, ptr %9, align 8, !tbaa !9
  %44 = load i64, ptr %9, align 8, !tbaa !9
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %45, i32 0, i32 6
  %47 = load i64, ptr %46, align 8, !tbaa !17
  %48 = urem i64 %44, %47
  %49 = icmp eq i64 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %41
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 149, ptr noundef @.str.1, ptr noundef @.str.11) #5
  unreachable

51:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %52 = load i64, ptr %9, align 8, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %53, i32 0, i32 6
  %55 = load i64, ptr %54, align 8, !tbaa !17
  %56 = udiv i64 %52, %55
  store i64 %56, ptr %10, align 8, !tbaa !9
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %71

59:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %60 = load ptr, ptr %7, align 8, !tbaa !5
  %61 = call i64 @ggml_nbytes(ptr noundef %60)
  store i64 %61, ptr %11, align 8, !tbaa !9
  %62 = load i64, ptr %11, align 8, !tbaa !9
  %63 = load i64, ptr %10, align 8, !tbaa !9
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %64, i32 0, i32 7
  %66 = load i64, ptr %65, align 8, !tbaa !18
  %67 = mul i64 %63, %66
  %68 = icmp eq i64 %62, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %59
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 154, ptr noundef @.str.1, ptr noundef @.str.12) #5
  unreachable

70:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %71

71:                                               ; preds = %70, %51
  %72 = load i64, ptr %8, align 8, !tbaa !9
  %73 = add nsw i64 %72, 1
  %74 = load i64, ptr %10, align 8, !tbaa !9
  %75 = mul nsw i64 %73, %74
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %76, i32 0, i32 8
  %78 = call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #6
  %79 = icmp sle i64 %75, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %71
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 157, ptr noundef @.str.1, ptr noundef @.str.13) #5
  unreachable

81:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %146, %81
  %83 = load i64, ptr %12, align 8, !tbaa !9
  %84 = load i64, ptr %10, align 8, !tbaa !9
  %85 = icmp slt i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %149

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %88, i32 0, i32 8
  %90 = load i64, ptr %8, align 8, !tbaa !9
  %91 = load i64, ptr %10, align 8, !tbaa !9
  %92 = mul nsw i64 %90, %91
  %93 = load i64, ptr %12, align 8, !tbaa !9
  %94 = add nsw i64 %92, %93
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %94) #6
  %96 = load i64, ptr %95, align 8, !tbaa !9
  store i64 %96, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !19
  %100 = getelementptr inbounds %struct.ggml_tensor, ptr %99, i32 0, i32 10
  %101 = load ptr, ptr %100, align 8, !tbaa !20
  %102 = load i64, ptr %14, align 8, !tbaa !9
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %103, i32 0, i32 6
  %105 = load i64, ptr %104, align 8, !tbaa !17
  %106 = mul i64 %102, %105
  %107 = getelementptr inbounds i8, ptr %101, i64 %106
  store ptr %107, ptr %15, align 8, !tbaa !5
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  %110 = load i64, ptr %12, align 8, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %111, i32 0, i32 6
  %113 = load i64, ptr %112, align 8, !tbaa !17
  %114 = mul i64 %110, %113
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %115, i32 0, i32 6
  %117 = load i64, ptr %116, align 8, !tbaa !17
  call void @ggml_backend_tensor_set(ptr noundef %108, ptr noundef %109, i64 noundef %114, i64 noundef %117)
  %118 = load ptr, ptr %7, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %121, label %120

120:                                              ; preds = %87
  store i32 4, ptr %13, align 4
  br label %143

121:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %122, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !11
  %125 = getelementptr inbounds %struct.ggml_tensor, ptr %124, i32 0, i32 10
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = load i64, ptr %14, align 8, !tbaa !9
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %128, i32 0, i32 7
  %130 = load i64, ptr %129, align 8, !tbaa !18
  %131 = mul i64 %127, %130
  %132 = getelementptr inbounds i8, ptr %126, i64 %131
  store ptr %132, ptr %16, align 8, !tbaa !5
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = load ptr, ptr %16, align 8, !tbaa !5
  %135 = load i64, ptr %12, align 8, !tbaa !9
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %136, i32 0, i32 7
  %138 = load i64, ptr %137, align 8, !tbaa !18
  %139 = mul i64 %135, %138
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ggml_opt_dataset, ptr %140, i32 0, i32 7
  %142 = load i64, ptr %141, align 8, !tbaa !18
  call void @ggml_backend_tensor_set(ptr noundef %133, ptr noundef %134, i64 noundef %139, i64 noundef %142)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  store i32 0, ptr %13, align 4
  br label %143

143:                                              ; preds = %121, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %144 = load i32, ptr %13, align 4
  switch i32 %144, label %150 [
    i32 0, label %145
    i32 4, label %146
  ]

145:                                              ; preds = %143
  br label %146

146:                                              ; preds = %145, %143
  %147 = load i64, ptr %12, align 8, !tbaa !9
  %148 = add nsw i64 %147, 1
  store i64 %148, ptr %12, align 8, !tbaa !9
  br label %82, !llvm.loop !25

149:                                              ; preds = %86
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret void

150:                                              ; preds = %143
  unreachable
}

declare zeroext i1 @ggml_is_contiguous(ptr noundef) #2

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

declare void @ggml_backend_tensor_set(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTS16ggml_opt_dataset", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !13, i64 64}
!13 = !{!"_ZTSSt6vectorIlSaIlEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!12, !10, i64 48}
!18 = !{!12, !10, i64 56}
!19 = !{!12, !6, i64 16}
!20 = !{!21, !6, i64 248}
!21 = !{!"_ZTS11ggml_tensor", !22, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !23, i64 80, !7, i64 84, !24, i64 148, !7, i64 152, !6, i64 232, !10, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!22 = !{!"_ZTS9ggml_type", !7, i64 0}
!23 = !{!"_ZTS7ggml_op", !7, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [70 x i8], align 1

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

declare i64 @ggml_nbytes(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @ggml_opt_dataset_get_batch(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #3 {
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %7, label %5

5:                                                ; preds = %4
  %6 = tail call zeroext i1 @ggml_is_contiguous(ptr noundef nonnull %1)
  br i1 %6, label %8, label %7

7:                                                ; preds = %5, %4
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 144, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.8) #4
  unreachable

8:                                                ; preds = %5
  %.not45 = icmp eq ptr %2, null
  br i1 %.not45, label %12, label %9

9:                                                ; preds = %8
  %10 = tail call zeroext i1 @ggml_is_contiguous(ptr noundef nonnull %2)
  br i1 %10, label %12, label %11

11:                                               ; preds = %9
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 145, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.9) #4
  unreachable

12:                                               ; preds = %9, %8
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  %16 = xor i1 %.not45, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %12
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 146, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.10) #4
  unreachable

18:                                               ; preds = %12
  %19 = tail call i64 @ggml_nbytes(ptr noundef nonnull %1)
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  %21 = load i64, ptr %20, align 8, !tbaa !15
  %22 = urem i64 %19, %21
  %23 = udiv i64 %19, %21
  %24 = icmp eq i64 %22, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %18
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 149, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.11) #4
  unreachable

26:                                               ; preds = %18
  br i1 %.not45, label %34, label %27

27:                                               ; preds = %26
  %28 = tail call i64 @ggml_nbytes(ptr noundef nonnull %2)
  %29 = getelementptr inbounds i8, ptr %0, i64 56
  %30 = load i64, ptr %29, align 8, !tbaa !16
  %31 = mul i64 %30, %23
  %32 = icmp eq i64 %28, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 154, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.12) #4
  unreachable

34:                                               ; preds = %27, %26
  %35 = add nsw i64 %3, 1
  %36 = mul nsw i64 %23, %35
  %37 = getelementptr inbounds i8, ptr %0, i64 64
  %38 = tail call noundef i64 @_ZNKSt6vectorIlSaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #5
  %.not46 = icmp sgt i64 %36, %38
  br i1 %.not46, label %55, label %.preheader

.preheader:                                       ; preds = %34
  %39 = icmp sgt i64 %23, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %40 = mul nsw i64 %23, %3
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  %42 = getelementptr inbounds i8, ptr %0, i64 56
  br i1 %.not45, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %.047.us = phi i64 [ %53, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %43 = add nsw i64 %.047.us, %40
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %43) #5
  %45 = load i64, ptr %44, align 8, !tbaa !17
  %46 = load ptr, ptr %41, align 8, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %46, i64 248
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = load i64, ptr %20, align 8, !tbaa !15
  %50 = mul i64 %49, %45
  %51 = getelementptr inbounds i8, ptr %48, i64 %50
  %52 = mul i64 %49, %.047.us
  tail call void @ggml_backend_tensor_set(ptr noundef nonnull %1, ptr noundef %51, i64 noundef %52, i64 noundef %49)
  %53 = add nuw nsw i64 %.047.us, 1
  %54 = icmp slt i64 %53, %23
  br i1 %54, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !24

55:                                               ; preds = %34
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 157, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.13) #4
  unreachable

._crit_edge:                                      ; preds = %.lr.ph.split, %.lr.ph.split.us, %.preheader
  ret void

.lr.ph.split:                                     ; preds = %.lr.ph, %.lr.ph.split
  %.047 = phi i64 [ %73, %.lr.ph.split ], [ 0, %.lr.ph ]
  %56 = add nsw i64 %.047, %40
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %56) #5
  %58 = load i64, ptr %57, align 8, !tbaa !17
  %59 = load ptr, ptr %41, align 8, !tbaa !18
  %60 = getelementptr inbounds i8, ptr %59, i64 248
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = load i64, ptr %20, align 8, !tbaa !15
  %63 = mul i64 %62, %58
  %64 = getelementptr inbounds i8, ptr %61, i64 %63
  %65 = mul i64 %62, %.047
  tail call void @ggml_backend_tensor_set(ptr noundef nonnull %1, ptr noundef %64, i64 noundef %65, i64 noundef %62)
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 248
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = load i64, ptr %42, align 8, !tbaa !16
  %70 = mul i64 %69, %58
  %71 = getelementptr inbounds i8, ptr %68, i64 %70
  %72 = mul i64 %69, %.047
  tail call void @ggml_backend_tensor_set(ptr noundef nonnull %2, ptr noundef %71, i64 noundef %72, i64 noundef %69)
  %73 = add nuw nsw i64 %.047, 1
  %74 = icmp slt i64 %73, %23
  br i1 %74, label %.lr.ph.split, label %._crit_edge, !llvm.loop !24
}

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

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

declare void @ggml_backend_tensor_set(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 = { noreturn }
attributes #5 = { 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 24}
!6 = !{!"_ZTS16ggml_opt_dataset", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !11, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIlSaIlEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIlSaIlEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIlSaIlEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!6, !10, i64 48}
!16 = !{!6, !10, i64 56}
!17 = !{!10, !10, i64 0}
!18 = !{!6, !7, i64 16}
!19 = !{!20, !7, i64 248}
!20 = !{!"_ZTS11ggml_tensor", !21, i64 0, !7, i64 8, !8, i64 16, !8, i64 48, !22, i64 80, !8, i64 84, !23, i64 148, !8, i64 152, !7, i64 232, !10, i64 240, !7, i64 248, !8, i64 256, !7, i64 320, !8, i64 328}
!21 = !{!"_ZTS9ggml_type", !8, i64 0}
!22 = !{!"_ZTS7ggml_op", !8, i64 0}
!23 = !{!"int", !8, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DivRemPairsPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass