; LLVM IR from ggml-org/ggml :: tests/test-mul-mat.ll (Z10load_modelR10test_modelPfS1_iiib)

; 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_init_params = type { i64, ptr, i8 }
%struct.ggml_tallocr = type { ptr, ptr, i64, i64 }
%struct.test_model = type { ptr, ptr, 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 [36 x i8], align 1
@__func__._Z10load_modelR10test_modelPfS1_iiib = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10load_modelR10test_modelPfS1_iiib(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.ggml_init_params, align 8
  %18 = alloca %struct.ggml_init_params, align 8
  %19 = alloca %struct.ggml_tallocr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  %20 = zext i1 %6 to i8
  store i8 %20, ptr %14, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %15, align 8, !tbaa !13
  %21 = load i32, ptr %11, align 4, !tbaa !9
  %22 = load i32, ptr %12, align 4, !tbaa !9
  %23 = mul nsw i32 %21, %22
  %24 = sext i32 %23 to i64
  %25 = call i64 @ggml_type_size(i32 noundef 0)
  %26 = mul i64 %24, %25
  %27 = load i64, ptr %15, align 8, !tbaa !13
  %28 = add i64 %27, %26
  store i64 %28, ptr %15, align 8, !tbaa !13
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = mul nsw i32 %29, %30
  %32 = sext i32 %31 to i64
  %33 = call i64 @ggml_type_size(i32 noundef 0)
  %34 = mul i64 %32, %33
  %35 = load i64, ptr %15, align 8, !tbaa !13
  %36 = add i64 %35, %34
  store i64 %36, ptr %15, align 8, !tbaa !13
  %37 = load i64, ptr %15, align 8, !tbaa !13
  %38 = add i64 %37, 1024
  store i64 %38, ptr %15, align 8, !tbaa !13
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef @__func__._Z10load_modelR10test_modelPfS1_iiib, i32 noundef 336)
  %40 = load i64, ptr %15, align 8, !tbaa !13
  %41 = trunc i64 %40 to i32
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @__func__._Z10load_modelR10test_modelPfS1_iiib, i32 noundef %41)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 2, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #4
  %43 = getelementptr inbounds %struct.ggml_init_params, ptr %17, i32 0, i32 0
  %44 = call i64 @ggml_tensor_overhead()
  %45 = load i32, ptr %16, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = mul i64 %44, %46
  store i64 %47, ptr %43, align 8, !tbaa !15
  %48 = getelementptr inbounds %struct.ggml_init_params, ptr %17, i32 0, i32 1
  store ptr null, ptr %48, align 8, !tbaa !17
  %49 = getelementptr inbounds %struct.ggml_init_params, ptr %17, i32 0, i32 2
  store i8 1, ptr %49, align 8, !tbaa !18
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.test_model, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !19
  %53 = icmp ne ptr %52, null
  br i1 %53, label %58, label %54

54:                                               ; preds = %7
  %55 = call ptr @ggml_backend_cpu_init()
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.test_model, ptr %56, i32 0, i32 2
  store ptr %55, ptr %57, align 8, !tbaa !19
  br label %58

58:                                               ; preds = %54, %7
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.test_model, ptr %59, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = load i64, ptr %15, align 8, !tbaa !13
  %63 = call ptr @ggml_backend_alloc_buffer(ptr noundef %61, i64 noundef %62)
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.test_model, ptr %64, i32 0, i32 3
  store ptr %63, ptr %65, align 8, !tbaa !21
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %17, i64 24, i1 false), !tbaa.struct !22
  %66 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %18)
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.test_model, ptr %67, i32 0, i32 4
  store ptr %66, ptr %68, align 8, !tbaa !23
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.test_model, ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !23
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = call ptr @ggml_new_tensor_2d(ptr noundef %71, i32 noundef 0, i64 noundef %73, i64 noundef %75)
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.test_model, ptr %77, i32 0, i32 0
  store ptr %76, ptr %78, align 8, !tbaa !24
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %79, i32 noundef %80)
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.test_model, ptr %82, i32 0, i32 4
  %84 = load ptr, ptr %83, align 8, !tbaa !23
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = call ptr @ggml_new_tensor_2d(ptr noundef %84, i32 noundef 0, i64 noundef %86, i64 noundef %88)
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.test_model, ptr %90, i32 0, i32 1
  store ptr %89, ptr %91, align 8, !tbaa !25
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %92, i32 noundef %93)
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.test_model, ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  call void @ggml_tallocr_new(ptr dead_on_unwind writable sret(%struct.ggml_tallocr) align 8 %19, ptr noundef %97)
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.test_model, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  %101 = call i32 @ggml_tallocr_alloc(ptr noundef %19, ptr noundef %100)
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.test_model, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !19
  %105 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %104)
  br i1 %105, label %106, label %117

106:                                              ; preds = %58
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.test_model, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !24
  %110 = getelementptr inbounds %struct.ggml_tensor, ptr %109, i32 0, i32 10
  %111 = load ptr, ptr %110, align 8, !tbaa !26
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.test_model, ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !24
  %116 = call i64 @ggml_nbytes(ptr noundef %115)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %111, ptr align 4 %112, i64 %116, i1 false)
  br label %126

117:                                              ; preds = %58
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.test_model, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !24
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.test_model, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !24
  %125 = call i64 @ggml_nbytes(ptr noundef %124)
  call void @ggml_backend_tensor_set(ptr noundef %120, ptr noundef %121, i64 noundef 0, i64 noundef %125)
  br label %126

126:                                              ; preds = %117, %106
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.test_model, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !25
  %130 = call i32 @ggml_tallocr_alloc(ptr noundef %19, ptr noundef %129)
  %131 = load ptr, ptr %8, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.test_model, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !19
  %134 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %133)
  br i1 %134, label %135, label %146

135:                                              ; preds = %126
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.test_model, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !25
  %139 = getelementptr inbounds %struct.ggml_tensor, ptr %138, i32 0, i32 10
  %140 = load ptr, ptr %139, align 8, !tbaa !26
  %141 = load ptr, ptr %10, align 8, !tbaa !5
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.test_model, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !25
  %145 = call i64 @ggml_nbytes(ptr noundef %144)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %140, ptr align 4 %141, i64 %145, i1 false)
  br label %155

146:                                              ; preds = %126
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.test_model, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !25
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.test_model, ptr %151, i32 0, i32 1
  %153 = load ptr, ptr %152, align 8, !tbaa !25
  %154 = call i64 @ggml_nbytes(ptr noundef %153)
  call void @ggml_backend_tensor_set(ptr noundef %149, ptr noundef %150, i64 noundef 0, i64 noundef %154)
  br label %155

155:                                              ; preds = %146, %135
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void
}

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

declare i64 @ggml_type_size(i32 noundef) #2

declare i32 @printf(ptr noundef, ...) #2

declare i64 @ggml_tensor_overhead() #2

declare ptr @ggml_backend_cpu_init() #2

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

declare ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare ptr @ggml_new_tensor_2d(ptr noundef, i32 noundef, i64 noundef, i64 noundef) #2

declare void @ggml_tallocr_new(ptr dead_on_unwind writable sret(%struct.ggml_tallocr) align 8, ptr noundef) #2

declare i32 @ggml_tallocr_alloc(ptr noundef, ptr noundef) #2

declare zeroext i1 @ggml_backend_is_cpu(ptr noundef) #2

declare i64 @ggml_nbytes(ptr noundef) #2

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"_ZTS16ggml_init_params", !14, i64 0, !6, i64 8, !12, i64 16}
!17 = !{!16, !6, i64 8}
!18 = !{!16, !12, i64 16}
!19 = !{!20, !6, i64 16}
!20 = !{!"_ZTS10test_model", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!20, !6, i64 24}
!22 = !{i64 0, i64 8, !13, i64 8, i64 8, !5, i64 16, i64 1, !11}
!23 = !{!20, !6, i64 32}
!24 = !{!20, !6, i64 0}
!25 = !{!20, !6, i64 8}
!26 = !{!27, !6, i64 248}
!27 = !{!"_ZTS11ggml_tensor", !28, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !29, i64 80, !7, i64 84, !10, i64 148, !7, i64 152, !6, i64 232, !14, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!28 = !{!"_ZTS9ggml_type", !7, i64 0}
!29 = !{!"_ZTS7ggml_op", !7, i64 0}


; 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.ggml_init_params = type { i64, ptr, i8 }
%struct.ggml_tallocr = type { ptr, ptr, i64, i64 }

@.str = external hidden unnamed_addr constant [36 x i8], align 1
@__func__._Z10load_modelR10test_modelPfS1_iiib = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10load_modelR10test_modelPfS1_iiib(ptr nocapture noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i1 noundef zeroext %6) local_unnamed_addr #0 {
  %8 = alloca %struct.ggml_init_params, align 8
  %9 = alloca %struct.ggml_tallocr, align 8
  %10 = mul nsw i32 %4, %3
  %11 = sext i32 %10 to i64
  %12 = tail call i64 @ggml_type_size(i32 noundef 0)
  %13 = mul i64 %12, %11
  %14 = mul nsw i32 %5, %4
  %15 = sext i32 %14 to i64
  %16 = tail call i64 @ggml_type_size(i32 noundef 0)
  %17 = mul i64 %16, %15
  %18 = add i64 %13, 1024
  %19 = add i64 %18, %17
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @__func__._Z10load_modelR10test_modelPfS1_iiib, i32 noundef 336)
  %21 = trunc i64 %19 to i32
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @__func__._Z10load_modelR10test_modelPfS1_iiib, i32 noundef %21)
  %23 = tail call i64 @ggml_tensor_overhead()
  %24 = shl i64 %23, 1
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %.not = icmp eq ptr %26, null
  br i1 %.not, label %27, label %29

27:                                               ; preds = %7
  %28 = tail call ptr @ggml_backend_cpu_init()
  store ptr %28, ptr %25, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %27, %7
  %30 = phi ptr [ %28, %27 ], [ %26, %7 ]
  %31 = tail call ptr @ggml_backend_alloc_buffer(ptr noundef %30, i64 noundef %19)
  %32 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %31, ptr %32, align 8, !tbaa !10
  store i64 %24, ptr %8, align 8, !tbaa !11
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store ptr null, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !13
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 16
  store i8 1, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !14
  %33 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %8)
  %34 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %33, ptr %34, align 8, !tbaa !16
  %35 = sext i32 %5 to i64
  %36 = sext i32 %3 to i64
  %37 = tail call ptr @ggml_new_tensor_2d(ptr noundef %33, i32 noundef 0, i64 noundef %35, i64 noundef %36)
  store ptr %37, ptr %0, align 8, !tbaa !17
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5, i32 noundef %3)
  %39 = load ptr, ptr %34, align 8, !tbaa !16
  %40 = sext i32 %4 to i64
  %41 = tail call ptr @ggml_new_tensor_2d(ptr noundef %39, i32 noundef 0, i64 noundef %35, i64 noundef %40)
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %41, ptr %42, align 8, !tbaa !18
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %5, i32 noundef %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  %44 = load ptr, ptr %32, align 8, !tbaa !10
  call void @ggml_tallocr_new(ptr dead_on_unwind nonnull writable sret(%struct.ggml_tallocr) align 8 %9, ptr noundef %44)
  %45 = load ptr, ptr %0, align 8, !tbaa !17
  %46 = call i32 @ggml_tallocr_alloc(ptr noundef nonnull %9, ptr noundef %45)
  %47 = load ptr, ptr %25, align 8, !tbaa !5
  %48 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %47)
  %49 = load ptr, ptr %0, align 8, !tbaa !17
  br i1 %48, label %50, label %54

50:                                               ; preds = %29
  %51 = getelementptr inbounds i8, ptr %49, i64 248
  %52 = load ptr, ptr %51, align 8, !tbaa !19
  %53 = call i64 @ggml_nbytes(ptr noundef %49)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %52, ptr align 4 %1, i64 %53, i1 false)
  br label %56

54:                                               ; preds = %29
  %55 = call i64 @ggml_nbytes(ptr noundef %49)
  call void @ggml_backend_tensor_set(ptr noundef %49, ptr noundef %1, i64 noundef 0, i64 noundef %55)
  br label %56

56:                                               ; preds = %54, %50
  %57 = load ptr, ptr %42, align 8, !tbaa !18
  %58 = call i32 @ggml_tallocr_alloc(ptr noundef nonnull %9, ptr noundef %57)
  %59 = load ptr, ptr %25, align 8, !tbaa !5
  %60 = call zeroext i1 @ggml_backend_is_cpu(ptr noundef %59)
  %61 = load ptr, ptr %42, align 8, !tbaa !18
  br i1 %60, label %62, label %66

62:                                               ; preds = %56
  %63 = getelementptr inbounds i8, ptr %61, i64 248
  %64 = load ptr, ptr %63, align 8, !tbaa !19
  %65 = call i64 @ggml_nbytes(ptr noundef %61)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %64, ptr align 4 %2, i64 %65, i1 false)
  br label %68

66:                                               ; preds = %56
  %67 = call i64 @ggml_nbytes(ptr noundef %61)
  call void @ggml_backend_tensor_set(ptr noundef %61, ptr noundef %2, i64 noundef 0, i64 noundef %67)
  br label %68

68:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  ret void
}

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

declare i64 @ggml_type_size(i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

declare i64 @ggml_tensor_overhead() local_unnamed_addr #2

declare ptr @ggml_backend_cpu_init() local_unnamed_addr #2

declare ptr @ggml_backend_alloc_buffer(ptr noundef, i64 noundef) local_unnamed_addr #2

declare ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @ggml_new_tensor_2d(ptr noundef, i32 noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

declare void @ggml_tallocr_new(ptr dead_on_unwind writable sret(%struct.ggml_tallocr) align 8, ptr noundef) local_unnamed_addr #2

declare i32 @ggml_tallocr_alloc(ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @ggml_backend_is_cpu(ptr noundef) local_unnamed_addr #2

declare i64 @ggml_nbytes(ptr noundef) local_unnamed_addr #2

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { nofree 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 16}
!6 = !{!"_ZTS10test_model", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 24}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!6, !7, i64 32}
!17 = !{!6, !7, i64 0}
!18 = !{!6, !7, i64 8}
!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, !12, 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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass