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

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

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%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::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 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.5" = type { i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [117 x i8], align 1
@stdout = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator", align 1
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca %"class.std::allocator", align 1
  %17 = alloca i64, align 8
  %18 = alloca %struct.mnist_model, align 8
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::allocator", align 1
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca %"class.std::vector.3", align 8
  %24 = alloca %"class.std::allocator.5", align 1
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %29 = call i64 @time(ptr noundef null) #7
  %30 = trunc i64 %29 to i32
  call void @srand(i32 noundef %30) #7
  call void @ggml_time_init()
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp ne i32 %31, 4
  br i1 %32, label %33, label %42

33:                                               ; preds = %2
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 5
  br i1 %35, label %36, label %42

36:                                               ; preds = %33
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 0
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str, ptr noundef %40) #7
  call void @exit(i32 noundef 1) #8
  unreachable

42:                                               ; preds = %33, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %43 = call ptr @ggml_opt_dataset_init(i64 noundef 784, i64 noundef 10, i64 noundef 10000, i64 noundef 500)
  store ptr %43, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #7
  %44 = load ptr, ptr %5, align 8, !tbaa !9
  %45 = getelementptr inbounds ptr, ptr %44, i64 2
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %46, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %47 unwind label %53

47:                                               ; preds = %42
  %48 = load ptr, ptr %6, align 8, !tbaa !9
  %49 = invoke noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %48)
          to label %50 unwind label %57

50:                                               ; preds = %47
  %51 = xor i1 %49, true
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br i1 %51, label %52, label %62

52:                                               ; preds = %50
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %197

53:                                               ; preds = %42
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %9, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %10, align 4
  br label %61

57:                                               ; preds = %47
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %9, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  br label %61

61:                                               ; preds = %57, %53
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #7
  br label %199

62:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %63, i64 3
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef %65, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %66 unwind label %72

66:                                               ; preds = %62
  %67 = load ptr, ptr %6, align 8, !tbaa !9
  %68 = invoke noundef zeroext i1 @_Z16mnist_label_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef %67)
          to label %69 unwind label %76

69:                                               ; preds = %66
  %70 = xor i1 %68, true
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br i1 %70, label %71, label %81

71:                                               ; preds = %69
  store i32 1, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %197

72:                                               ; preds = %62
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %9, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %10, align 4
  br label %80

76:                                               ; preds = %66
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %9, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  br label %80

80:                                               ; preds = %76, %72
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %199

81:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %82 = call i32 @rand() #7
  %83 = srem i32 %82, 10000
  store i32 %83, ptr %14, align 4, !tbaa !5
  %84 = load ptr, ptr @stdout, align 8, !tbaa !9
  %85 = load ptr, ptr %6, align 8, !tbaa !9
  %86 = load i32, ptr %14, align 4, !tbaa !5
  call void @_Z17mnist_image_printP8_IO_FILEP16ggml_opt_dataseti(ptr noundef %84, ptr noundef %85, i32 noundef %86)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = icmp sge i32 %87, 5
  br i1 %88, label %89, label %93

89:                                               ; preds = %81
  %90 = load ptr, ptr %5, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %90, i64 4
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  br label %94

93:                                               ; preds = %81
  br label %94

94:                                               ; preds = %93, %89
  %95 = phi ptr [ %92, %89 ], [ @.str.1, %93 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef %95, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %96 unwind label %143

96:                                               ; preds = %94
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %97 = invoke i64 @ggml_time_us()
          to label %98 unwind label %147

98:                                               ; preds = %96
  store i64 %97, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 208, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #7
  %99 = load ptr, ptr %5, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %99, i64 1
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %101, ptr noundef nonnull align 1 dereferenceable(1) %20)
          to label %102 unwind label %151

102:                                              ; preds = %98
  invoke void @_Z26mnist_model_init_from_fileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ii(ptr dead_on_unwind writable sret(%struct.mnist_model) align 8 %18, ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 1000, i32 noundef 500)
          to label %103 unwind label %155

103:                                              ; preds = %102
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  invoke void @_Z17mnist_model_buildR11mnist_model(ptr noundef nonnull align 8 dereferenceable(208) %18)
          to label %104 unwind label %160

104:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %105 = invoke i64 @ggml_time_us()
          to label %106 unwind label %164

106:                                              ; preds = %104
  %107 = load i64, ptr %17, align 8, !tbaa !11
  %108 = sub nsw i64 %105, %107
  store i64 %108, ptr %21, align 8, !tbaa !11
  %109 = load ptr, ptr @stdout, align 8, !tbaa !9
  %110 = load i64, ptr %21, align 8, !tbaa !11
  %111 = sitofp i64 %110 to double
  %112 = fdiv double %111, 1.000000e+03
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.2, ptr noundef @__func__.main, double noundef %112) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %114 = load ptr, ptr %6, align 8, !tbaa !9
  %115 = invoke noundef ptr @_Z16mnist_model_evalR11mnist_modelP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(208) %18, ptr noundef %114)
          to label %116 unwind label %168

116:                                              ; preds = %106
  store ptr %115, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef 10000, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %117 unwind label %172

117:                                              ; preds = %116
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #7
  %118 = load ptr, ptr %22, align 8, !tbaa !9
  %119 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  invoke void @ggml_opt_result_pred(ptr noundef %118, ptr noundef %119)
          to label %120 unwind label %176

120:                                              ; preds = %117
  %121 = load ptr, ptr @stdout, align 8, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %123) #7
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.3, ptr noundef @__func__.main, i32 noundef %125) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %127 = load ptr, ptr %22, align 8, !tbaa !9
  invoke void @ggml_opt_result_loss(ptr noundef %127, ptr noundef %25, ptr noundef %26)
          to label %128 unwind label %180

128:                                              ; preds = %120
  %129 = load ptr, ptr @stdout, align 8, !tbaa !9
  %130 = load double, ptr %25, align 8, !tbaa !13
  %131 = load double, ptr %26, align 8, !tbaa !13
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.4, ptr noundef @__func__.main, double noundef %130, double noundef %131) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %133 = load ptr, ptr %22, align 8, !tbaa !9
  invoke void @ggml_opt_result_accuracy(ptr noundef %133, ptr noundef %27, ptr noundef %28)
          to label %134 unwind label %184

134:                                              ; preds = %128
  %135 = load ptr, ptr @stdout, align 8, !tbaa !9
  %136 = load double, ptr %27, align 8, !tbaa !13
  %137 = fmul double 1.000000e+02, %136
  %138 = load double, ptr %28, align 8, !tbaa !13
  %139 = fmul double 1.000000e+02, %138
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef @.str.5, ptr noundef @__func__.main, double noundef %137, double noundef %139) #7
  %141 = load ptr, ptr %22, align 8, !tbaa !9
  invoke void @ggml_opt_result_free(ptr noundef %141)
          to label %142 unwind label %184

142:                                              ; preds = %134
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208) %18) #7
  call void @llvm.lifetime.end.p0(i64 208, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %197

143:                                              ; preds = %94
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %9, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  br label %196

147:                                              ; preds = %96
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %9, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %10, align 4
  br label %195

151:                                              ; preds = %98
  %152 = landingpad { ptr, i32 }
          cleanup
  %153 = extractvalue { ptr, i32 } %152, 0
  store ptr %153, ptr %9, align 8
  %154 = extractvalue { ptr, i32 } %152, 1
  store i32 %154, ptr %10, align 4
  br label %159

155:                                              ; preds = %102
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %9, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #7
  br label %159

159:                                              ; preds = %155, %151
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %20) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #7
  br label %194

160:                                              ; preds = %103
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %9, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %10, align 4
  br label %193

164:                                              ; preds = %104
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %9, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %10, align 4
  br label %192

168:                                              ; preds = %106
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %9, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %10, align 4
  br label %191

172:                                              ; preds = %116
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %9, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #7
  br label %190

176:                                              ; preds = %117
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %9, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %10, align 4
  br label %189

180:                                              ; preds = %120
  %181 = landingpad { ptr, i32 }
          cleanup
  %182 = extractvalue { ptr, i32 } %181, 0
  store ptr %182, ptr %9, align 8
  %183 = extractvalue { ptr, i32 } %181, 1
  store i32 %183, ptr %10, align 4
  br label %188

184:                                              ; preds = %134, %128
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %9, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  br label %188

188:                                              ; preds = %184, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  br label %189

189:                                              ; preds = %188, %176
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  br label %190

190:                                              ; preds = %189, %172
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  br label %191

191:                                              ; preds = %190, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %192

192:                                              ; preds = %191, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %193

193:                                              ; preds = %192, %160
  call void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208) %18) #7
  br label %194

194:                                              ; preds = %193, %159
  call void @llvm.lifetime.end.p0(i64 208, ptr %18) #7
  br label %195

195:                                              ; preds = %194, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #7
  br label %196

196:                                              ; preds = %195, %143
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %199

197:                                              ; preds = %142, %71, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %198 = load i32, ptr %3, align 4
  ret i32 %198

199:                                              ; preds = %196, %80, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %200

200:                                              ; preds = %199
  %201 = load ptr, ptr %9, align 8
  %202 = load i32, ptr %10, align 4
  %203 = insertvalue { ptr, i32 } poison, ptr %201, 0
  %204 = insertvalue { ptr, i32 } %203, i32 %202, 1
  resume { ptr, i32 } %204
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #1

declare void @ggml_time_init() #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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

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

declare noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

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

declare noundef zeroext i1 @_Z16mnist_label_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #2

; Function Attrs: nounwind
declare i32 @rand() #1

declare void @_Z17mnist_image_printP8_IO_FILEP16ggml_opt_dataseti(ptr noundef, ptr noundef, i32 noundef) #2

declare i64 @ggml_time_us() #2

declare void @_Z26mnist_model_init_from_fileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ii(ptr dead_on_unwind writable sret(%struct.mnist_model) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #2

declare void @_Z17mnist_model_buildR11mnist_model(ptr noundef nonnull align 8 dereferenceable(208)) #2

declare noundef ptr @_Z16mnist_model_evalR11mnist_modelP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) #2

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

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

declare void @ggml_opt_result_pred(ptr noundef, ptr noundef) #2

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

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

declare void @ggml_opt_result_loss(ptr noundef, ptr noundef, ptr noundef) #2

declare void @ggml_opt_result_accuracy(ptr noundef, ptr noundef, ptr noundef) #2

declare void @ggml_opt_result_free(ptr noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #5 align 2

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

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

attributes #0 = { mustprogress norecurse 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { noreturn 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%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::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 }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.5" = type { i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [117 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [30 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca %struct.mnist_model, align 8
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator", align 1
  %12 = alloca %"class.std::vector.3", align 8
  %13 = alloca %"class.std::allocator.5", align 1
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = tail call i64 @time(ptr noundef null) #8
  %19 = trunc i64 %18 to i32
  tail call void @srand(i32 noundef %19) #8
  tail call void @ggml_time_init()
  %20 = add i32 %0, -6
  %or.cond = icmp ult i32 %20, -2
  br i1 %or.cond, label %21, label %25

21:                                               ; preds = %2
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  %23 = load ptr, ptr %1, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str, ptr noundef %23) #9
  tail call void @exit(i32 noundef 1) #10
  unreachable

25:                                               ; preds = %2
  %26 = tail call ptr @ggml_opt_dataset_init(i64 noundef 784, i64 noundef 10, i64 noundef 10000, i64 noundef 500)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #8
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %28, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %29 unwind label %32

29:                                               ; preds = %25
  %30 = invoke noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %26)
          to label %31 unwind label %34

31:                                               ; preds = %29
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  br i1 %30, label %37, label %126

32:                                               ; preds = %25
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %36

34:                                               ; preds = %29
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  br label %36

36:                                               ; preds = %34, %32
  %.pn = phi { ptr, i32 } [ %35, %34 ], [ %33, %32 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #8
  br label %127

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  %38 = getelementptr inbounds i8, ptr %1, i64 24
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %39, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %40 unwind label %43

40:                                               ; preds = %37
  %41 = invoke noundef zeroext i1 @_Z16mnist_label_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %26)
          to label %42 unwind label %45

42:                                               ; preds = %40
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br i1 %41, label %48, label %126

43:                                               ; preds = %37
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %47

45:                                               ; preds = %40
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  br label %47

47:                                               ; preds = %45, %43
  %.pn38 = phi { ptr, i32 } [ %46, %45 ], [ %44, %43 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %127

48:                                               ; preds = %42
  %49 = call i32 @rand() #8
  %50 = srem i32 %49, 10000
  %51 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @_Z17mnist_image_printP8_IO_FILEP16ggml_opt_dataseti(ptr noundef %51, ptr noundef %26, i32 noundef %50)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #8
  %52 = icmp ugt i32 %0, 4
  br i1 %52, label %53, label %56

53:                                               ; preds = %48
  %54 = getelementptr inbounds i8, ptr %1, i64 32
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %48, %53
  %57 = phi ptr [ %55, %53 ], [ @.str.1, %48 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef %57, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %58 unwind label %96

58:                                               ; preds = %56
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  %59 = invoke i64 @ggml_time_us()
          to label %60 unwind label %98

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #8
  %61 = getelementptr inbounds i8, ptr %1, i64 8
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %62, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %63 unwind label %100

63:                                               ; preds = %60
  invoke void @_Z26mnist_model_init_from_fileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ii(ptr dead_on_unwind nonnull writable sret(%struct.mnist_model) align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull align 8 dereferenceable(32) %7, i32 noundef 1000, i32 noundef 500)
          to label %64 unwind label %102

64:                                               ; preds = %63
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  invoke void @_Z17mnist_model_buildR11mnist_model(ptr noundef nonnull align 8 dereferenceable(208) %9)
          to label %65 unwind label %105

65:                                               ; preds = %64
  %66 = invoke i64 @ggml_time_us()
          to label %67 unwind label %107

67:                                               ; preds = %65
  %68 = sub nsw i64 %66, %59
  %69 = load ptr, ptr @stdout, align 8, !tbaa !5
  %70 = sitofp i64 %68 to double
  %71 = fdiv double %70, 1.000000e+03
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__.main, double noundef %71) #8
  %73 = invoke noundef ptr @_Z16mnist_model_evalR11mnist_modelP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(208) %9, ptr noundef %26)
          to label %74 unwind label %109

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #8
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef 10000, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %75 unwind label %111

75:                                               ; preds = %74
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  %76 = call noundef ptr @_ZNSt6vectorIiSaIiEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  invoke void @ggml_opt_result_pred(ptr noundef %73, ptr noundef %76)
          to label %77 unwind label %113

77:                                               ; preds = %75
  %78 = load ptr, ptr @stdout, align 8, !tbaa !5
  %79 = sext i32 %50 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %79) #8
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.3, ptr noundef nonnull @__func__.main, i32 noundef %81) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #8
  invoke void @ggml_opt_result_loss(ptr noundef %73, ptr noundef nonnull %14, ptr noundef nonnull %15)
          to label %83 unwind label %115

83:                                               ; preds = %77
  %84 = load ptr, ptr @stdout, align 8, !tbaa !5
  %85 = load double, ptr %14, align 8, !tbaa !11
  %86 = load double, ptr %15, align 8, !tbaa !11
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.main, double noundef %85, double noundef %86) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #8
  invoke void @ggml_opt_result_accuracy(ptr noundef %73, ptr noundef nonnull %16, ptr noundef nonnull %17)
          to label %88 unwind label %117

88:                                               ; preds = %83
  %89 = load ptr, ptr @stdout, align 8, !tbaa !5
  %90 = load double, ptr %16, align 8, !tbaa !11
  %91 = fmul double %90, 1.000000e+02
  %92 = load double, ptr %17, align 8, !tbaa !11
  %93 = fmul double %92, 1.000000e+02
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.5, ptr noundef nonnull @__func__.main, double noundef %91, double noundef %93) #8
  invoke void @ggml_opt_result_free(ptr noundef %73)
          to label %95 unwind label %117

95:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  call void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208) %9) #8
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %9) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %126

96:                                               ; preds = %56
  %97 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  br label %125

98:                                               ; preds = %58
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %124

100:                                              ; preds = %60
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %63
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #8
  br label %104

104:                                              ; preds = %102, %100
  %.pn40 = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #8
  br label %123

105:                                              ; preds = %64
  %106 = landingpad { ptr, i32 }
          cleanup
  br label %122

107:                                              ; preds = %65
  %108 = landingpad { ptr, i32 }
          cleanup
  br label %122

109:                                              ; preds = %67
  %110 = landingpad { ptr, i32 }
          cleanup
  br label %122

111:                                              ; preds = %74
  %112 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #8
  br label %121

113:                                              ; preds = %75
  %114 = landingpad { ptr, i32 }
          cleanup
  br label %120

115:                                              ; preds = %77
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %119

117:                                              ; preds = %88, %83
  %118 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #8
  br label %119

119:                                              ; preds = %117, %115
  %.pn42 = phi { ptr, i32 } [ %118, %117 ], [ %116, %115 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #8
  br label %120

120:                                              ; preds = %119, %113
  %.pn42.pn = phi { ptr, i32 } [ %.pn42, %119 ], [ %114, %113 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #8
  br label %121

121:                                              ; preds = %120, %111
  %.pn42.pn.pn = phi { ptr, i32 } [ %.pn42.pn, %120 ], [ %112, %111 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #8
  br label %122

122:                                              ; preds = %107, %121, %109, %105
  %.pn42.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %106, %105 ], [ %108, %107 ], [ %.pn42.pn.pn, %121 ], [ %110, %109 ]
  call void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208) %9) #8
  br label %123

123:                                              ; preds = %122, %104
  %.pn42.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn.pn.pn.pn, %122 ], [ %.pn40, %104 ]
  call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %9) #8
  br label %124

124:                                              ; preds = %123, %98
  %.pn42.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn.pn.pn.pn.pn, %123 ], [ %99, %98 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #8
  br label %125

125:                                              ; preds = %124, %96
  %.pn42.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn.pn.pn.pn.pn.pn, %124 ], [ %97, %96 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #8
  br label %127

126:                                              ; preds = %42, %31, %95
  %.0 = phi i32 [ 0, %95 ], [ 1, %31 ], [ 1, %42 ]
  ret i32 %.0

127:                                              ; preds = %125, %47, %36
  %.pn42.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn42.pn.pn.pn.pn.pn.pn.pn.pn, %125 ], [ %.pn38, %47 ], [ %.pn, %36 ]
  resume { ptr, i32 } %.pn42.pn.pn.pn.pn.pn.pn.pn.pn.pn
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

declare void @ggml_time_init() local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

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

declare noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #6 align 2

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

declare noundef zeroext i1 @_Z16mnist_label_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

declare void @_Z17mnist_image_printP8_IO_FILEP16ggml_opt_dataseti(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i64 @ggml_time_us() local_unnamed_addr #2

declare void @_Z26mnist_model_init_from_fileRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES6_ii(ptr dead_on_unwind writable sret(%struct.mnist_model) align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @_Z17mnist_model_buildR11mnist_model(ptr noundef nonnull align 8 dereferenceable(208)) local_unnamed_addr #2

declare noundef ptr @_Z16mnist_model_evalR11mnist_modelP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(208), ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #7 align 2

declare void @ggml_opt_result_pred(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare void @ggml_opt_result_loss(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ggml_opt_result_accuracy(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ggml_opt_result_free(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11mnist_modelD2Ev(ptr noundef nonnull align 8 dereferenceable(208)) unnamed_addr #6 align 2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass