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

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }
%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] }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.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.3 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::basic_ifstream", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::fpos", align 8
  %11 = alloca [784 x i8], align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 520, ptr %6) #6
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %6, ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef 4)
  %17 = load ptr, ptr %6, align 8, !tbaa !9
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %6, i64 %19
  %21 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %20)
          to label %22 unwind label %28

22:                                               ; preds = %2
  br i1 %21, label %23, label %32

23:                                               ; preds = %22
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %25) #6
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str, ptr noundef %26) #6
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %105

28:                                               ; preds = %33, %32, %2
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %7, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %8, align 4
  br label %107

32:                                               ; preds = %22
  invoke void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef 16)
          to label %33 unwind label %28

33:                                               ; preds = %32
  %34 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %35 = load i64, ptr %34, align 8
  %36 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %37 = load i64, ptr %36, align 8
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %6, i64 %35, i64 %37)
          to label %39 unwind label %28

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 784, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = invoke ptr @ggml_opt_dataset_data(ptr noundef %40)
          to label %42 unwind label %53

42:                                               ; preds = %39
  store ptr %41, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = invoke ptr @ggml_get_data_f32(ptr noundef %43)
          to label %45 unwind label %57

45:                                               ; preds = %42
  store ptr %44, ptr %13, align 8, !tbaa !5
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ggml_tensor, ptr %46, i32 0, i32 2
  %48 = getelementptr inbounds [4 x i64], ptr %47, i64 0, i64 0
  %49 = load i64, ptr %48, align 8, !tbaa !11
  %50 = icmp eq i64 %49, 784
  br i1 %50, label %61, label %51

51:                                               ; preds = %45
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.1, i32 noundef 30, ptr noundef @.str.2, ptr noundef @.str.3) #7
          to label %52 unwind label %57

52:                                               ; preds = %51
  unreachable

53:                                               ; preds = %39
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %7, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %8, align 4
  br label %104

57:                                               ; preds = %51, %42
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %7, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %8, align 4
  br label %103

61:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %99, %61
  %63 = load i64, ptr %14, align 8, !tbaa !11
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ggml_tensor, ptr %64, i32 0, i32 2
  %66 = getelementptr inbounds [4 x i64], ptr %65, i64 0, i64 1
  %67 = load i64, ptr %66, align 8, !tbaa !11
  %68 = icmp slt i64 %63, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %62
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %102

70:                                               ; preds = %62
  %71 = getelementptr inbounds [784 x i8], ptr %11, i64 0, i64 0
  %72 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef %71, i64 noundef 784)
          to label %73 unwind label %78

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !11
  br label %74

74:                                               ; preds = %95, %73
  %75 = load i64, ptr %15, align 8, !tbaa !11
  %76 = icmp slt i64 %75, 784
  br i1 %76, label %82, label %77

77:                                               ; preds = %74
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %98

78:                                               ; preds = %70
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %7, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %103

82:                                               ; preds = %74
  %83 = load i64, ptr %15, align 8, !tbaa !11
  %84 = getelementptr inbounds [784 x i8], ptr %11, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !13
  %86 = zext i8 %85 to i32
  %87 = sitofp i32 %86 to float
  %88 = fdiv float %87, 2.550000e+02
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = load i64, ptr %14, align 8, !tbaa !11
  %91 = mul nsw i64 %90, 784
  %92 = load i64, ptr %15, align 8, !tbaa !11
  %93 = add nsw i64 %91, %92
  %94 = getelementptr inbounds float, ptr %89, i64 %93
  store float %88, ptr %94, align 4, !tbaa !14
  br label %95

95:                                               ; preds = %82
  %96 = load i64, ptr %15, align 8, !tbaa !11
  %97 = add nsw i64 %96, 1
  store i64 %97, ptr %15, align 8, !tbaa !11
  br label %74, !llvm.loop !16

98:                                               ; preds = %77
  br label %99

99:                                               ; preds = %98
  %100 = load i64, ptr %14, align 8, !tbaa !11
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %14, align 8, !tbaa !11
  br label %62, !llvm.loop !18

102:                                              ; preds = %69
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 784, ptr %11) #6
  br label %105

103:                                              ; preds = %78, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %104

104:                                              ; preds = %103, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 784, ptr %11) #6
  br label %107

105:                                              ; preds = %102, %23
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %6) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %6) #6
  %106 = load i1, ptr %3, align 1
  ret i1 %106

107:                                              ; preds = %104, %28
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %6) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr %6) #6
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr %7, align 8
  %110 = load i32, ptr %8, align 4
  %111 = insertvalue { ptr, i32 } poison, ptr %109, 0
  %112 = insertvalue { ptr, i32 } %111, i32 %110, 1
  resume { ptr, i32 } %112
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #3 align 2

declare ptr @ggml_opt_dataset_data(ptr noundef) #4

declare ptr @ggml_get_data_f32(ptr noundef) #4

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn "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 = { nounwind }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::fpos" = type { i64, %struct.__mbstate_t }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.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.3 = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z16mnist_image_loadRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP16ggml_opt_dataset(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::basic_ifstream", align 8
  %4 = alloca %"class.std::fpos", align 8
  %5 = alloca [784 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %3) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %3, ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 4)
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr %3, i64 %8
  %10 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %9)
          to label %11 unwind label %16

11:                                               ; preds = %2
  br i1 %10, label %12, label %18

12:                                               ; preds = %11
  %13 = load ptr, ptr @stderr, align 8, !tbaa !8
  %14 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str, ptr noundef %14) #7
  br label %90

16:                                               ; preds = %18, %2
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %91

18:                                               ; preds = %11
  call void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 16)
  %19 = load i64, ptr %4, align 8
  %20 = getelementptr inbounds i8, ptr %4, i64 8
  %21 = load i64, ptr %20, align 8
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 %19, i64 %21)
          to label %23 unwind label %16

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 784, ptr nonnull %5) #6
  %24 = invoke ptr @ggml_opt_dataset_data(ptr noundef %1)
          to label %25 unwind label %36

25:                                               ; preds = %23
  %26 = invoke ptr @ggml_get_data_f32(ptr noundef %24)
          to label %27 unwind label %38

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %24, i64 16
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %30 = icmp eq i64 %29, 784
  br i1 %30, label %.preheader25, label %34

.preheader25:                                     ; preds = %27
  %31 = getelementptr inbounds i8, ptr %24, i64 24
  %32 = load i64, ptr %31, align 8, !tbaa !11
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader25
  %scevgep29 = getelementptr inbounds i8, ptr %5, i64 784
  %invariant.gep = getelementptr i8, ptr %26, i64 3136
  br label %.lr.ph

34:                                               ; preds = %27
  invoke void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.1, i32 noundef 30, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #8
          to label %35 unwind label %38

35:                                               ; preds = %34
  unreachable

36:                                               ; preds = %23
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %89

38:                                               ; preds = %34, %25
  %39 = landingpad { ptr, i32 }
          cleanup
  br label %89

._crit_edge:                                      ; preds = %middle.block, %.preheader25
  call void @llvm.lifetime.end.p0(i64 784, ptr nonnull %5) #6
  br label %90

.lr.ph:                                           ; preds = %.lr.ph.preheader, %middle.block
  %.01627 = phi i64 [ %60, %middle.block ], [ 0, %.lr.ph.preheader ]
  %40 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull %5, i64 noundef 784)
          to label %.preheader unwind label %63

.preheader:                                       ; preds = %.lr.ph
  %41 = mul i64 %.01627, 3136
  %gep = getelementptr i8, ptr %invariant.gep, i64 %41
  %scevgep = getelementptr i8, ptr %26, i64 %41
  %.idx = mul i64 %.01627, 3136
  %42 = getelementptr inbounds i8, ptr %26, i64 %.idx
  %bound0 = icmp ult ptr %scevgep, %scevgep29
  %bound1 = icmp ult ptr %5, %gep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph, label %vector.body

vector.body:                                      ; preds = %.preheader, %vector.body
  %index = phi i64 [ %index.next.3, %vector.body ], [ 0, %.preheader ]
  %43 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %index
  %wide.load = load <4 x i8>, ptr %43, align 16, !tbaa !13, !alias.scope !14
  %44 = uitofp <4 x i8> %wide.load to <4 x float>
  %45 = fdiv <4 x float> %44, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %46 = getelementptr inbounds float, ptr %42, i64 %index
  store <4 x float> %45, ptr %46, align 4, !tbaa !17, !alias.scope !19, !noalias !14
  %index.next = or disjoint i64 %index, 4
  %47 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %index.next
  %wide.load.1 = load <4 x i8>, ptr %47, align 4, !tbaa !13, !alias.scope !14
  %48 = uitofp <4 x i8> %wide.load.1 to <4 x float>
  %49 = fdiv <4 x float> %48, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %50 = getelementptr inbounds float, ptr %42, i64 %index.next
  store <4 x float> %49, ptr %50, align 4, !tbaa !17, !alias.scope !19, !noalias !14
  %index.next.1 = or disjoint i64 %index, 8
  %51 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %index.next.1
  %wide.load.2 = load <4 x i8>, ptr %51, align 8, !tbaa !13, !alias.scope !14
  %52 = uitofp <4 x i8> %wide.load.2 to <4 x float>
  %53 = fdiv <4 x float> %52, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %54 = getelementptr inbounds float, ptr %42, i64 %index.next.1
  store <4 x float> %53, ptr %54, align 4, !tbaa !17, !alias.scope !19, !noalias !14
  %index.next.2 = or disjoint i64 %index, 12
  %55 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %index.next.2
  %wide.load.3 = load <4 x i8>, ptr %55, align 4, !tbaa !13, !alias.scope !14
  %56 = uitofp <4 x i8> %wide.load.3 to <4 x float>
  %57 = fdiv <4 x float> %56, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %58 = getelementptr inbounds float, ptr %42, i64 %index.next.2
  store <4 x float> %57, ptr %58, align 4, !tbaa !17, !alias.scope !19, !noalias !14
  %index.next.3 = add nuw nsw i64 %index, 16
  %59 = icmp eq i64 %index.next.3, 784
  br i1 %59, label %middle.block, label %vector.body, !llvm.loop !21

middle.block:                                     ; preds = %vector.body, %scalar.ph
  %60 = add nuw nsw i64 %.01627, 1
  %61 = load i64, ptr %31, align 8, !tbaa !11
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.lr.ph, label %._crit_edge, !llvm.loop !25

63:                                               ; preds = %.lr.ph
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %89

scalar.ph:                                        ; preds = %.preheader, %scalar.ph
  %.026 = phi i64 [ %88, %scalar.ph ], [ 0, %.preheader ]
  %65 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %.026
  %66 = load i8, ptr %65, align 4, !tbaa !13
  %67 = uitofp i8 %66 to float
  %68 = fdiv float %67, 2.550000e+02
  %69 = getelementptr inbounds float, ptr %42, i64 %.026
  store float %68, ptr %69, align 4, !tbaa !17
  %70 = or disjoint i64 %.026, 1
  %71 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !13
  %73 = uitofp i8 %72 to float
  %74 = fdiv float %73, 2.550000e+02
  %75 = getelementptr inbounds float, ptr %42, i64 %70
  store float %74, ptr %75, align 4, !tbaa !17
  %76 = or disjoint i64 %.026, 2
  %77 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %76
  %78 = load i8, ptr %77, align 2, !tbaa !13
  %79 = uitofp i8 %78 to float
  %80 = fdiv float %79, 2.550000e+02
  %81 = getelementptr inbounds float, ptr %42, i64 %76
  store float %80, ptr %81, align 4, !tbaa !17
  %82 = or disjoint i64 %.026, 3
  %83 = getelementptr inbounds [784 x i8], ptr %5, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !13
  %85 = uitofp i8 %84 to float
  %86 = fdiv float %85, 2.550000e+02
  %87 = getelementptr inbounds float, ptr %42, i64 %82
  store float %86, ptr %87, align 4, !tbaa !17
  %88 = add nuw nsw i64 %.026, 4
  %exitcond.not.3 = icmp eq i64 %88, 784
  br i1 %exitcond.not.3, label %middle.block, label %scalar.ph, !llvm.loop !26

89:                                               ; preds = %38, %63, %36
  %.pn.pn = phi { ptr, i32 } [ %37, %36 ], [ %64, %63 ], [ %39, %38 ]
  call void @llvm.lifetime.end.p0(i64 784, ptr nonnull %5) #6
  br label %91

90:                                               ; preds = %._crit_edge, %12
  %.017 = xor i1 %10, true
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %3) #6
  ret i1 %.017

91:                                               ; preds = %89, %16
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %89 ], [ %17, %16 ]
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgESt4fposI11__mbstate_tE(ptr noundef nonnull align 8 dereferenceable(16), i64, i64) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4fposI11__mbstate_tEC2El(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) unnamed_addr #3 align 2

declare ptr @ggml_opt_dataset_data(ptr noundef) local_unnamed_addr #4

declare ptr @ggml_get_data_f32(ptr noundef) local_unnamed_addr #4

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn "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 = { nounwind }
attributes #7 = { cold 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = !{!15}
!15 = distinct !{!15, !16}
!16 = distinct !{!16, !"LVerDomain"}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !10, i64 0}
!19 = !{!20}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !22, !23, !24}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22, !23}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass