; LLVM IR from ggml-org/ggml :: tests (test-mul-mat0)

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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__.check_gradient = external hidden unnamed_addr constant [134 x i8], align 1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local float @get_element(ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @set_element(ptr noundef, i32 noundef, float noundef) #2

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @check_gradient(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, float noundef %6, float noundef %7, float noundef %8) #2 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca float, align 4
  %32 = alloca float, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !9
  store i32 %5, ptr %15, align 4, !tbaa !9
  store float %6, ptr %16, align 4, !tbaa !11
  store float %7, ptr %17, align 4, !tbaa !11
  store float %8, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 1, ptr %19, align 4, !tbaa !9
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ggml_set_loss(ptr noundef %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = call ptr @ggml_new_graph_custom(ptr noundef %34, i64 noundef 2048, i1 noundef zeroext true)
  store ptr %35, ptr %20, align 8, !tbaa !5
  %36 = load ptr, ptr %20, align 8, !tbaa !5
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %36, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load ptr, ptr %20, align 8, !tbaa !5
  %40 = call ptr @ggml_graph_dup(ptr noundef %38, ptr noundef %39)
  store ptr %40, ptr %21, align 8, !tbaa !5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %21, align 8, !tbaa !5
  call void @ggml_build_backward_expand(ptr noundef %41, ptr noundef %42, ptr noundef %43, i1 noundef zeroext false)
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  %45 = load ptr, ptr %20, align 8, !tbaa !5
  %46 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %44, ptr noundef %45, i32 noundef 1)
  %47 = load ptr, ptr %21, align 8, !tbaa !5
  call void @ggml_graph_reset(ptr noundef %47)
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load ptr, ptr %21, align 8, !tbaa !5
  %50 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %48, ptr noundef %49, i32 noundef 1)
  %51 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ggml_graph_dump_dot(ptr noundef %51, ptr noundef null, ptr noundef @.str.2)
  %52 = load ptr, ptr %21, align 8, !tbaa !5
  %53 = load ptr, ptr %20, align 8, !tbaa !5
  call void @ggml_graph_dump_dot(ptr noundef %52, ptr noundef %53, ptr noundef @.str.3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %184, %9
  %55 = load i32, ptr %22, align 4, !tbaa !9
  %56 = load i32, ptr %15, align 4, !tbaa !9
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 2, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %187

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = load i32, ptr %22, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = call i64 @ggml_nelements(ptr noundef %64)
  store i64 %65, ptr %24, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store i64 0, ptr %25, align 8, !tbaa !13
  br label %66

66:                                               ; preds = %180, %59
  %67 = load i64, ptr %25, align 8, !tbaa !13
  %68 = load i64, ptr %24, align 8, !tbaa !13
  %69 = icmp slt i64 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 5, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %183

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i32, ptr %22, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = load i64, ptr %25, align 8, !tbaa !13
  %78 = trunc i64 %77 to i32
  %79 = call float @get_element(ptr noundef %76, i32 noundef %78)
  store float %79, ptr %26, align 4, !tbaa !11
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = load i32, ptr %22, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %80, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = load i64, ptr %25, align 8, !tbaa !13
  %86 = trunc i64 %85 to i32
  %87 = load float, ptr %26, align 4, !tbaa !11
  %88 = load float, ptr %16, align 4, !tbaa !11
  %89 = fadd float %87, %88
  call void @set_element(ptr noundef %84, i32 noundef %86, float noundef %89)
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = load ptr, ptr %20, align 8, !tbaa !5
  %92 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %90, ptr noundef %91, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = call float @ggml_get_f32_1d(ptr noundef %93, i32 noundef 0)
  store float %94, ptr %27, align 4, !tbaa !11
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = load i32, ptr %22, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = load i64, ptr %25, align 8, !tbaa !13
  %101 = trunc i64 %100 to i32
  %102 = load float, ptr %26, align 4, !tbaa !11
  %103 = load float, ptr %16, align 4, !tbaa !11
  %104 = fsub float %102, %103
  call void @set_element(ptr noundef %99, i32 noundef %101, float noundef %104)
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load ptr, ptr %20, align 8, !tbaa !5
  %107 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %105, ptr noundef %106, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = call float @ggml_get_f32_1d(ptr noundef %108, i32 noundef 0)
  store float %109, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %110 = load float, ptr %27, align 4, !tbaa !11
  %111 = load float, ptr %28, align 4, !tbaa !11
  %112 = fsub float %110, %111
  %113 = load float, ptr %16, align 4, !tbaa !11
  %114 = fmul float 2.000000e+00, %113
  %115 = fdiv float %112, %114
  store float %115, ptr %29, align 4, !tbaa !11
  %116 = load ptr, ptr %12, align 8, !tbaa !5
  %117 = load i32, ptr %22, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds ptr, ptr %116, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = load i64, ptr %25, align 8, !tbaa !13
  %122 = trunc i64 %121 to i32
  %123 = load float, ptr %26, align 4, !tbaa !11
  call void @set_element(ptr noundef %120, i32 noundef %122, float noundef %123)
  %124 = load ptr, ptr %21, align 8, !tbaa !5
  call void @ggml_graph_reset(ptr noundef %124)
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = load ptr, ptr %21, align 8, !tbaa !5
  %127 = call i32 @ggml_graph_compute_with_ctx(ptr noundef %125, ptr noundef %126, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %128 = load ptr, ptr %21, align 8, !tbaa !5
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = load i32, ptr %22, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = call ptr @ggml_graph_get_grad(ptr noundef %128, ptr noundef %133)
  %135 = load i64, ptr %25, align 8, !tbaa !13
  %136 = trunc i64 %135 to i32
  %137 = call float @get_element(ptr noundef %134, i32 noundef %136)
  store float %137, ptr %30, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %138 = load float, ptr %29, align 4, !tbaa !11
  %139 = load float, ptr %30, align 4, !tbaa !11
  %140 = fsub float %138, %139
  %141 = call float @llvm.fabs.f32(float %140)
  store float %141, ptr %31, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %142 = load float, ptr %29, align 4, !tbaa !11
  %143 = fcmp une float %142, 0.000000e+00
  br i1 %143, label %144, label %154

144:                                              ; preds = %71
  %145 = load float, ptr %29, align 4, !tbaa !11
  %146 = load float, ptr %30, align 4, !tbaa !11
  %147 = fsub float %145, %146
  %148 = call float @llvm.fabs.f32(float %147)
  %149 = fpext float %148 to double
  %150 = load float, ptr %29, align 4, !tbaa !11
  %151 = fpext float %150 to double
  %152 = call double @llvm.fabs.f64(double %151)
  %153 = fdiv double %149, %152
  br label %155

154:                                              ; preds = %71
  br label %155

155:                                              ; preds = %154, %144
  %156 = phi double [ %153, %144 ], [ 0.000000e+00, %154 ]
  %157 = fptrunc double %156 to float
  store float %157, ptr %32, align 4, !tbaa !11
  %158 = load float, ptr %31, align 4, !tbaa !11
  %159 = load float, ptr %17, align 4, !tbaa !11
  %160 = fcmp ogt float %158, %159
  br i1 %160, label %165, label %161

161:                                              ; preds = %155
  %162 = load float, ptr %32, align 4, !tbaa !11
  %163 = load float, ptr %18, align 4, !tbaa !11
  %164 = fcmp ogt float %162, %163
  br i1 %164, label %165, label %179

165:                                              ; preds = %161, %155
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = load i32, ptr %14, align 4, !tbaa !9
  %168 = load i32, ptr %22, align 4, !tbaa !9
  %169 = load i64, ptr %25, align 8, !tbaa !13
  %170 = load float, ptr %29, align 4, !tbaa !11
  %171 = fpext float %170 to double
  %172 = load float, ptr %30, align 4, !tbaa !11
  %173 = fpext float %172 to double
  %174 = load float, ptr %31, align 4, !tbaa !11
  %175 = fpext float %174 to double
  %176 = load float, ptr %32, align 4, !tbaa !11
  %177 = fpext float %176 to double
  %178 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef %166, i32 noundef %167, i32 noundef %168, i64 noundef %169, double noundef %171, double noundef %173, double noundef %175, double noundef %177)
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 145, ptr noundef @__PRETTY_FUNCTION__.check_gradient) #6
  unreachable

179:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %180

180:                                              ; preds = %179
  %181 = load i64, ptr %25, align 8, !tbaa !13
  %182 = add nsw i64 %181, 1
  store i64 %182, ptr %25, align 8, !tbaa !13
  br label %66, !llvm.loop !15

183:                                              ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %22, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %22, align 4, !tbaa !9
  br label %54, !llvm.loop !17

187:                                              ; preds = %58
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  ret i1 true
}

declare void @ggml_set_loss(ptr noundef) #3

declare ptr @ggml_new_graph_custom(ptr noundef, i64 noundef, i1 noundef zeroext) #3

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

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

declare void @ggml_build_backward_expand(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #3

declare i32 @ggml_graph_compute_with_ctx(ptr noundef, ptr noundef, i32 noundef) #3

declare void @ggml_graph_reset(ptr noundef) #3

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

declare i64 @ggml_nelements(ptr noundef) #3

declare float @ggml_get_f32_1d(ptr noundef, i32 noundef) #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

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

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


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

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__.check_gradient = external hidden unnamed_addr constant [134 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local float @get_element(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @set_element(ptr noundef, i32 noundef, float noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @check_gradient(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, float noundef %6, float noundef %7, float noundef %8) local_unnamed_addr #1 {
  tail call void @ggml_set_loss(ptr noundef %3) #5
  %10 = tail call ptr @ggml_new_graph_custom(ptr noundef %1, i64 noundef 2048, i1 noundef zeroext true) #5
  tail call void @ggml_build_forward_expand(ptr noundef %10, ptr noundef %3) #5
  %11 = tail call ptr @ggml_graph_dup(ptr noundef %1, ptr noundef %10) #5
  tail call void @ggml_build_backward_expand(ptr noundef %1, ptr noundef %1, ptr noundef %11, i1 noundef zeroext false) #5
  %12 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %1, ptr noundef %10, i32 noundef 1) #5
  tail call void @ggml_graph_reset(ptr noundef %11) #5
  %13 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %1, ptr noundef %11, i32 noundef 1) #5
  tail call void @ggml_graph_dump_dot(ptr noundef %10, ptr noundef null, ptr noundef nonnull @.str.2) #5
  tail call void @ggml_graph_dump_dot(ptr noundef %11, ptr noundef %10, ptr noundef nonnull @.str.3) #5
  %14 = icmp sgt i32 %5, 0
  br i1 %14, label %.lr.ph85, label %._crit_edge86

.lr.ph85:                                         ; preds = %9
  %15 = fmul float %6, 2.000000e+00
  %wide.trip.count = zext nneg i32 %5 to i64
  br label %16

._crit_edge86:                                    ; preds = %._crit_edge, %9
  ret i1 true

16:                                               ; preds = %.lr.ph85, %._crit_edge
  %indvars.iv = phi i64 [ 0, %.lr.ph85 ], [ %indvars.iv.next, %._crit_edge ]
  %17 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call i64 @ggml_nelements(ptr noundef %18) #5
  %20 = icmp sgt i64 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %59, %16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond97.not, label %._crit_edge86, label %16, !llvm.loop !9

.lr.ph:                                           ; preds = %16, %59
  %.07582 = phi i64 [ %60, %59 ], [ 0, %16 ]
  %21 = load ptr, ptr %17, align 8, !tbaa !5
  %22 = trunc i64 %.07582 to i32
  %23 = tail call float @get_element(ptr noundef %21, i32 noundef %22)
  %24 = load ptr, ptr %17, align 8, !tbaa !5
  %25 = fadd float %23, %6
  tail call void @set_element(ptr noundef %24, i32 noundef %22, float noundef %25)
  %26 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %1, ptr noundef %10, i32 noundef 1) #5
  %27 = tail call float @ggml_get_f32_1d(ptr noundef %3, i32 noundef 0) #5
  %28 = load ptr, ptr %17, align 8, !tbaa !5
  %29 = fsub float %23, %6
  tail call void @set_element(ptr noundef %28, i32 noundef %22, float noundef %29)
  %30 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %1, ptr noundef %10, i32 noundef 1) #5
  %31 = tail call float @ggml_get_f32_1d(ptr noundef %3, i32 noundef 0) #5
  %32 = fsub float %27, %31
  %33 = fdiv float %32, %15
  %34 = load ptr, ptr %17, align 8, !tbaa !5
  tail call void @set_element(ptr noundef %34, i32 noundef %22, float noundef %23)
  tail call void @ggml_graph_reset(ptr noundef %11) #5
  %35 = tail call i32 @ggml_graph_compute_with_ctx(ptr noundef %1, ptr noundef %11, i32 noundef 1) #5
  %36 = load ptr, ptr %17, align 8, !tbaa !5
  %37 = tail call ptr @ggml_graph_get_grad(ptr noundef %11, ptr noundef %36) #5
  %38 = tail call float @get_element(ptr noundef %37, i32 noundef %22)
  %39 = fsub float %33, %38
  %40 = tail call float @llvm.fabs.f32(float %39)
  %41 = fcmp une float %33, 0.000000e+00
  br i1 %41, label %42, label %47

42:                                               ; preds = %.lr.ph
  %43 = fpext float %40 to double
  %44 = tail call float @llvm.fabs.f32(float %33)
  %45 = fpext float %44 to double
  %46 = fdiv double %43, %45
  br label %47

47:                                               ; preds = %.lr.ph, %42
  %48 = phi double [ %46, %42 ], [ 0.000000e+00, %.lr.ph ]
  %49 = fptrunc double %48 to float
  %50 = fcmp ogt float %40, %7
  %51 = fcmp ogt float %49, %8
  %or.cond = select i1 %50, i1 true, i1 %51
  br i1 %or.cond, label %52, label %59

52:                                               ; preds = %47
  %53 = trunc nuw nsw i64 %indvars.iv to i32
  %54 = fpext float %33 to double
  %55 = fpext float %38 to double
  %56 = fpext float %40 to double
  %57 = fpext float %49 to double
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef %0, i32 noundef %4, i32 noundef %53, i64 noundef %.07582, double noundef %54, double noundef %55, double noundef %56, double noundef %57)
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 145, ptr noundef nonnull @__PRETTY_FUNCTION__.check_gradient) #6
  unreachable

59:                                               ; preds = %47
  %60 = add nuw nsw i64 %.07582, 1
  %exitcond.not = icmp eq i64 %60, %19
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11
}

declare void @ggml_set_loss(ptr noundef) local_unnamed_addr #2

declare ptr @ggml_new_graph_custom(ptr noundef, i64 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare ptr @ggml_graph_dup(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ggml_build_backward_expand(ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

declare void @ggml_graph_reset(ptr noundef) local_unnamed_addr #2

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

declare i64 @ggml_nelements(ptr noundef) local_unnamed_addr #2

declare float @ggml_get_f32_1d(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @ggml_graph_get_grad(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #3

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

attributes #0 = { 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 #1 = { 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 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass