; LLVM IR from ggml-org/ggml :: examples/mnist (mnist-common)

; 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 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.mnist_model = type { %"class.std::__cxx11::basic_string", ptr, %"class.std::vector", i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_backend *, std::allocator<ggml_backend *>>::_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.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE = external hidden unnamed_addr constant [17 x i8], align 1
@__const._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.params = external hidden unnamed_addr constant %struct.ggml_init_params, align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

declare i64 @ggml_nbytes(ptr noundef) #3

; 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) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

declare ptr @ggml_set_name(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP11ggml_tensorSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #6 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.ggml_init_params, align 8
  %7 = alloca %struct.ggml_init_params, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::vector.5", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::initializer_list", align 8
  %13 = alloca [4 x ptr], align 8
  %14 = alloca %"class.std::initializer_list", align 8
  %15 = alloca [6 x ptr], align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %21) #7
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.106, ptr noundef @__func__._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 @__const._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.params, i64 24, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %7, ptr align 8 %6, i64 24, i1 false), !tbaa.struct !9
  %24 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %7)
  store ptr %24, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %25 = call ptr @gguf_init_empty()
  store ptr %25, ptr %8, align 8, !tbaa !5
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.mnist_model, ptr %27, i32 0, i32 0
  %29 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %28) #7
  call void @gguf_set_val_str(ptr noundef %26, ptr noundef @.str.12, ptr noundef %29)
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mnist_model, ptr %30, i32 0, i32 0
  %32 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %31, ptr noundef @.str.14)
          to label %33 unwind label %58

33:                                               ; preds = %2
  br i1 %32, label %34, label %66

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #7
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mnist_model, ptr %35, i32 0, i32 7
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  store ptr %37, ptr %13, align 8, !tbaa !5
  %38 = getelementptr inbounds ptr, ptr %13, i64 1
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mnist_model, ptr %39, i32 0, i32 8
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  store ptr %41, ptr %38, align 8, !tbaa !5
  %42 = getelementptr inbounds ptr, ptr %13, i64 2
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mnist_model, ptr %43, i32 0, i32 9
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  store ptr %45, ptr %42, align 8, !tbaa !5
  %46 = getelementptr inbounds ptr, ptr %13, i64 3
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mnist_model, ptr %47, i32 0, i32 10
  %49 = load ptr, ptr %48, align 8, !tbaa !25
  store ptr %49, ptr %46, align 8, !tbaa !5
  %50 = getelementptr inbounds %"class.std::initializer_list", ptr %12, i32 0, i32 0
  store ptr %13, ptr %50, align 8, !tbaa !26
  %51 = getelementptr inbounds %"class.std::initializer_list", ptr %12, i32 0, i32 1
  store i64 4, ptr %51, align 8, !tbaa !28
  %52 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %53 = load ptr, ptr %52, align 8
  %54 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %55 = load i64, ptr %54, align 8
  %56 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr %53, i64 %55)
          to label %57 unwind label %62

57:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %110

58:                                               ; preds = %157, %155, %150, %107, %66, %2
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %10, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %11, align 4
  br label %160

62:                                               ; preds = %34
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #7
  br label %160

66:                                               ; preds = %33
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mnist_model, ptr %67, i32 0, i32 0
  %69 = invoke noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %68, ptr noundef @.str.35)
          to label %70 unwind label %58

70:                                               ; preds = %66
  br i1 %69, label %71, label %107

71:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #7
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.mnist_model, ptr %72, i32 0, i32 11
  %74 = load ptr, ptr %73, align 8, !tbaa !29
  store ptr %74, ptr %15, align 8, !tbaa !5
  %75 = getelementptr inbounds ptr, ptr %15, i64 1
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.mnist_model, ptr %76, i32 0, i32 12
  %78 = load ptr, ptr %77, align 8, !tbaa !30
  store ptr %78, ptr %75, align 8, !tbaa !5
  %79 = getelementptr inbounds ptr, ptr %15, i64 2
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mnist_model, ptr %80, i32 0, i32 13
  %82 = load ptr, ptr %81, align 8, !tbaa !31
  store ptr %82, ptr %79, align 8, !tbaa !5
  %83 = getelementptr inbounds ptr, ptr %15, i64 3
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.mnist_model, ptr %84, i32 0, i32 14
  %86 = load ptr, ptr %85, align 8, !tbaa !32
  store ptr %86, ptr %83, align 8, !tbaa !5
  %87 = getelementptr inbounds ptr, ptr %15, i64 4
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mnist_model, ptr %88, i32 0, i32 15
  %90 = load ptr, ptr %89, align 8, !tbaa !33
  store ptr %90, ptr %87, align 8, !tbaa !5
  %91 = getelementptr inbounds ptr, ptr %15, i64 5
  %92 = load ptr, ptr %3, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.mnist_model, ptr %92, i32 0, i32 16
  %94 = load ptr, ptr %93, align 8, !tbaa !34
  store ptr %94, ptr %91, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 0
  store ptr %15, ptr %95, align 8, !tbaa !26
  %96 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 1
  store i64 6, ptr %96, align 8, !tbaa !28
  %97 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %100 = load i64, ptr %99, align 8
  %101 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr %98, i64 %100)
          to label %102 unwind label %103

102:                                              ; preds = %71
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #7
  br label %109

103:                                              ; preds = %71
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %10, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #7
  br label %160

107:                                              ; preds = %70
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.1, i32 noundef 435, ptr noundef @.str.2, ptr noundef @.str.98) #8
          to label %108 unwind label %58

108:                                              ; preds = %107
  unreachable

109:                                              ; preds = %102
  br label %110

110:                                              ; preds = %109, %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr %9, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = call ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %111) #7
  %113 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %112, ptr %113, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  %115 = call ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #7
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  br label %117

117:                                              ; preds = %144, %110
  %118 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %118, label %120, label %119

119:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %150

120:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  store ptr %122, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load ptr, ptr %19, align 8, !tbaa !5
  %125 = invoke ptr @ggml_dup_tensor(ptr noundef %123, ptr noundef %124)
          to label %126 unwind label %146

126:                                              ; preds = %120
  store ptr %125, ptr %20, align 8, !tbaa !5
  %127 = load ptr, ptr %20, align 8, !tbaa !5
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.ggml_tensor, ptr %128, i32 0, i32 11
  %130 = getelementptr inbounds [64 x i8], ptr %129, i64 0, i64 0
  %131 = invoke ptr @ggml_set_name(ptr noundef %127, ptr noundef %130)
          to label %132 unwind label %146

132:                                              ; preds = %126
  %133 = load ptr, ptr %19, align 8, !tbaa !5
  %134 = load ptr, ptr %20, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ggml_tensor, ptr %134, i32 0, i32 10
  %136 = load ptr, ptr %135, align 8, !tbaa !35
  %137 = load ptr, ptr %19, align 8, !tbaa !5
  %138 = invoke i64 @ggml_nbytes(ptr noundef %137)
          to label %139 unwind label %146

139:                                              ; preds = %132
  invoke void @ggml_backend_tensor_get(ptr noundef %133, ptr noundef %136, i64 noundef 0, i64 noundef %138)
          to label %140 unwind label %146

140:                                              ; preds = %139
  %141 = load ptr, ptr %8, align 8, !tbaa !5
  %142 = load ptr, ptr %20, align 8, !tbaa !5
  invoke void @gguf_add_tensor(ptr noundef %141, ptr noundef %142)
          to label %143 unwind label %146

143:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %144

144:                                              ; preds = %143
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %117

146:                                              ; preds = %140, %139, %132, %126, %120
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %10, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %160

150:                                              ; preds = %119
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %152) #7
  %154 = invoke zeroext i1 @gguf_write_to_file(ptr noundef %151, ptr noundef %153, i1 noundef zeroext false)
          to label %155 unwind label %58

155:                                              ; preds = %150
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @ggml_free(ptr noundef %156)
          to label %157 unwind label %58

157:                                              ; preds = %155
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  invoke void @gguf_free(ptr noundef %158)
          to label %159 unwind label %58

159:                                              ; preds = %157
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void

160:                                              ; preds = %146, %103, %62, %58
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %10, align 8
  %163 = load i32, ptr %11, align 4
  %164 = insertvalue { ptr, i32 } poison, ptr %162, 0
  %165 = insertvalue { ptr, i32 } %164, i32 %163, 1
  resume { ptr, i32 } %165
}

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

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

declare ptr @gguf_init_empty() #3

declare void @gguf_set_val_str(ptr noundef, ptr noundef, ptr noundef) #3

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

declare ptr @ggml_dup_tensor(ptr noundef, ptr noundef) #3

declare void @ggml_backend_tensor_get(ptr noundef, ptr noundef, i64 noundef, i64 noundef) #3

declare void @gguf_add_tensor(ptr noundef, ptr noundef) #3

declare zeroext i1 @gguf_write_to_file(ptr noundef, ptr noundef, i1 noundef zeroext) #3

declare void @ggml_free(ptr noundef) #3

declare void @gguf_free(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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 = !{i64 0, i64 8, !10, i64 8, i64 8, !5, i64 16, i64 1, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !6, i64 88}
!15 = !{!"_ZTS11mnist_model", !16, i64 0, !6, i64 32, !18, i64 40, !22, i64 64, !22, i64 68, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !17, i64 0, !11, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"_ZTSSt6vectorIP12ggml_backendSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIP12ggml_backendSaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIP12ggml_backendSaIS1_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP12ggml_backendSaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"int", !7, i64 0}
!23 = !{!15, !6, i64 96}
!24 = !{!15, !6, i64 104}
!25 = !{!15, !6, i64 112}
!26 = !{!27, !6, i64 0}
!27 = !{!"_ZTSSt16initializer_listIP11ggml_tensorE", !6, i64 0, !11, i64 8}
!28 = !{!27, !11, i64 8}
!29 = !{!15, !6, i64 120}
!30 = !{!15, !6, i64 128}
!31 = !{!15, !6, i64 136}
!32 = !{!15, !6, i64 144}
!33 = !{!15, !6, i64 152}
!34 = !{!15, !6, i64 160}
!35 = !{!36, !6, i64 248}
!36 = !{!"_ZTS11ggml_tensor", !37, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !38, i64 80, !7, i64 84, !22, i64 148, !7, i64 152, !6, i64 232, !11, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!37 = !{!"_ZTS9ggml_type", !7, i64 0}
!38 = !{!"_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 }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl" = type { %"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ggml_tensor *, std::allocator<ggml_tensor *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.98 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE = external hidden unnamed_addr constant [17 x i8], align 1
@__const._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.params = external hidden unnamed_addr constant %struct.ggml_init_params, align 8

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: noreturn
declare void @ggml_abort(ptr noundef, i32 noundef, ptr 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) #0

declare i64 @ggml_nbytes(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #4

declare ptr @ggml_set_name(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP11ggml_tensorSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.5", align 8
  %4 = alloca [4 x ptr], align 16
  %5 = alloca [6 x ptr], align 16
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.106, ptr noundef nonnull @__func__._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE, ptr noundef %8)
  %10 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 @__const._Z16mnist_model_saveR11mnist_modelRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.params)
  %11 = tail call ptr @gguf_init_empty()
  %12 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #7
  tail call void @gguf_set_val_str(ptr noundef %11, ptr noundef nonnull @.str.12, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %13 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.14)
  br i1 %13, label %14, label %26

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  %15 = getelementptr inbounds i8, ptr %0, i64 88
  %16 = load <2 x ptr>, ptr %15, align 8, !tbaa !5
  store <2 x ptr> %16, ptr %4, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %4, i64 16
  %18 = getelementptr inbounds i8, ptr %0, i64 104
  %19 = load <2 x ptr>, ptr %18, align 8, !tbaa !5
  store <2 x ptr> %19, ptr %17, align 16, !tbaa !5
  %20 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr nonnull %4, i64 4)
          to label %21 unwind label %24

21:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %43

22:                                               ; preds = %67, %66, %._crit_edge, %41
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %69

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %69

26:                                               ; preds = %2
  %27 = call noundef zeroext i1 @_ZSteqIcSt11char_traitsIcESaIcEEbRKNSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.35)
  br i1 %27, label %28, label %41

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #7
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  %30 = load <2 x ptr>, ptr %29, align 8, !tbaa !5
  store <2 x ptr> %30, ptr %5, align 16, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %5, i64 16
  %32 = getelementptr inbounds i8, ptr %0, i64 136
  %33 = load <2 x ptr>, ptr %32, align 8, !tbaa !5
  store <2 x ptr> %33, ptr %31, align 16, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %5, i64 32
  %35 = getelementptr inbounds i8, ptr %0, i64 152
  %36 = load <2 x ptr>, ptr %35, align 8, !tbaa !5
  store <2 x ptr> %36, ptr %34, align 16, !tbaa !5
  %37 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EEaSESt16initializer_listIS1_E(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr nonnull %5, i64 6)
          to label %38 unwind label %39

38:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  br label %43

39:                                               ; preds = %28
  %40 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  br label %69

41:                                               ; preds = %26
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.1, i32 noundef 435, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.98) #8
          to label %42 unwind label %22

42:                                               ; preds = %41
  unreachable

43:                                               ; preds = %38, %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %44 = call ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  store ptr %44, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %45 = call ptr @_ZNSt6vectorIP11ggml_tensorSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  store ptr %45, ptr %7, align 8
  %46 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %46, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %61, %43
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %47 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #7
  %48 = invoke zeroext i1 @gguf_write_to_file(ptr noundef %11, ptr noundef %47, i1 noundef zeroext false)
          to label %66 unwind label %22

.lr.ph:                                           ; preds = %43, %61
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  %51 = invoke ptr @ggml_dup_tensor(ptr noundef %10, ptr noundef %50)
          to label %52 unwind label %64

52:                                               ; preds = %.lr.ph
  %53 = getelementptr inbounds i8, ptr %50, i64 256
  %54 = invoke ptr @ggml_set_name(ptr noundef %51, ptr noundef nonnull %53)
          to label %55 unwind label %64

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %51, i64 248
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = invoke i64 @ggml_nbytes(ptr noundef %50)
          to label %59 unwind label %64

59:                                               ; preds = %55
  invoke void @ggml_backend_tensor_get(ptr noundef %50, ptr noundef %57, i64 noundef 0, i64 noundef %58)
          to label %60 unwind label %64

60:                                               ; preds = %59
  invoke void @gguf_add_tensor(ptr noundef %11, ptr noundef nonnull %51)
          to label %61 unwind label %64

61:                                               ; preds = %60
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  %63 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPP11ggml_tensorSt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  br i1 %63, label %.lr.ph, label %._crit_edge

64:                                               ; preds = %60, %59, %55, %52, %.lr.ph
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %69

66:                                               ; preds = %._crit_edge
  invoke void @ggml_free(ptr noundef %10)
          to label %67 unwind label %22

67:                                               ; preds = %66
  invoke void @gguf_free(ptr noundef %11)
          to label %68 unwind label %22

68:                                               ; preds = %67
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  ret void

69:                                               ; preds = %64, %39, %24, %22
  %.pn = phi { ptr, i32 } [ %65, %64 ], [ %23, %22 ], [ %25, %24 ], [ %40, %39 ]
  call void @_ZNSt6vectorIP11ggml_tensorSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn
}

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

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

declare ptr @gguf_init_empty() local_unnamed_addr #3

declare void @gguf_set_val_str(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare ptr @ggml_dup_tensor(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @ggml_backend_tensor_get(ptr noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #3

declare void @gguf_add_tensor(ptr noundef, ptr noundef) local_unnamed_addr #3

declare zeroext i1 @gguf_write_to_file(ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

declare void @ggml_free(ptr noundef) local_unnamed_addr #3

declare void @gguf_free(ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { inlinehint 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 #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn }

!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, !6, i64 248}
!10 = !{!"_ZTS11ggml_tensor", !11, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !12, i64 80, !7, i64 84, !13, i64 148, !7, i64 152, !6, i64 232, !14, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!11 = !{!"_ZTS9ggml_type", !7, i64 0}
!12 = !{!"_ZTS7ggml_op", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass