; LLVM IR from ggml-org/ggml :: src (ggml-opt)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ggml_init_params = type { i64, ptr, i8 }
%struct.ggml_opt_params = type { ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr }
%struct.ggml_opt_context = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::mersenne_twister_engine", ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, i8, ptr, ptr, ptr }
%"class.std::mersenne_twister_engine" = type { [624 x i64], i64 }
%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] }
%struct.ggml_cgraph = type { i32, i32, i32, ptr, ptr, ptr, ptr, %struct.ggml_hash_set, i32 }
%struct.ggml_hash_set = type { i64, ptr, ptr }

@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

declare i64 @ggml_tensor_overhead() #3

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

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

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

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

declare ptr @ggml_backend_cpu_buffer_type() #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local ptr @ggml_opt_init(ptr noundef byval(%struct.ggml_opt_params) align 8 %0) #6 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.ggml_init_params, align 8
  %12 = alloca %struct.ggml_init_params, align 8
  %13 = alloca i64, align 8
  %14 = alloca %struct.ggml_init_params, align 8
  %15 = alloca %struct.ggml_init_params, align 8
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %25 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 5192) #9
  invoke void @_ZN16ggml_opt_contextC2Ev(ptr noundef nonnull align 8 dereferenceable(5192) %25)
          to label %26 unwind label %62

26:                                               ; preds = %1
  store ptr %25, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ggml_opt_context, ptr %29, i32 0, i32 0
  store ptr %28, ptr %30, align 8, !tbaa !14
  %31 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !19
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ggml_opt_context, ptr %33, i32 0, i32 5
  store ptr %32, ptr %34, align 8, !tbaa !20
  %35 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !21
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ggml_opt_context, ptr %37, i32 0, i32 10
  store ptr %36, ptr %38, align 8, !tbaa !22
  %39 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !23
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ggml_opt_context, ptr %41, i32 0, i32 11
  store ptr %40, ptr %42, align 8, !tbaa !24
  %43 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 6
  %44 = load i32, ptr %43, align 8, !tbaa !25
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ggml_opt_context, ptr %45, i32 0, i32 20
  store i32 %44, ptr %46, align 8, !tbaa !26
  %47 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 7
  %48 = load ptr, ptr %47, align 8, !tbaa !27
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ggml_opt_context, ptr %49, i32 0, i32 23
  store ptr %48, ptr %50, align 8, !tbaa !28
  %51 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 8
  %52 = load ptr, ptr %51, align 8, !tbaa !29
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ggml_opt_context, ptr %53, i32 0, i32 24
  store ptr %52, ptr %54, align 8, !tbaa !30
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ggml_opt_context, ptr %55, i32 0, i32 10
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = getelementptr inbounds %struct.ggml_tensor, ptr %57, i32 0, i32 10
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = icmp ne ptr %59, null
  br i1 %60, label %66, label %61

61:                                               ; preds = %26
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 303, ptr noundef @.str.1, ptr noundef @.str.14) #10
  unreachable

62:                                               ; preds = %1
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %4, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %25, i64 noundef 5192) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %616

66:                                               ; preds = %26
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ggml_opt_context, ptr %67, i32 0, i32 20
  %69 = load i32, ptr %68, align 8, !tbaa !26
  %70 = icmp sge i32 %69, 1
  br i1 %70, label %72, label %71

71:                                               ; preds = %66
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 304, ptr noundef @.str.1, ptr noundef @.str.15) #10
  unreachable

72:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #8
  %73 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %74 = load i32, ptr %73, align 4, !tbaa !35
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %87, label %76

76:                                               ; preds = %72
  %77 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %78 = load i32, ptr %77, align 4, !tbaa !35
  %79 = icmp eq i32 %78, 2
  br i1 %79, label %80, label %85

80:                                               ; preds = %76
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.ggml_opt_context, ptr %81, i32 0, i32 20
  %83 = load i32, ptr %82, align 8, !tbaa !26
  %84 = icmp sgt i32 %83, 1
  br label %85

85:                                               ; preds = %80, %76
  %86 = phi i1 [ false, %76 ], [ %84, %80 ]
  br label %87

87:                                               ; preds = %85, %72
  %88 = phi i1 [ true, %72 ], [ %86, %85 ]
  %89 = zext i1 %88 to i8
  store i8 %89, ptr %6, align 1, !tbaa !36
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ggml_opt_context, ptr %90, i32 0, i32 10
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  call void @ggml_set_input(ptr noundef %92)
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ggml_opt_context, ptr %93, i32 0, i32 11
  %95 = load ptr, ptr %94, align 8, !tbaa !24
  call void @ggml_set_output(ptr noundef %95)
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ggml_opt_context, ptr %96, i32 0, i32 5
  %98 = load ptr, ptr %97, align 8, !tbaa !20
  %99 = call ptr @ggml_new_graph_custom(ptr noundef %98, i64 noundef 2048, i1 noundef zeroext true)
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ggml_opt_context, ptr %100, i32 0, i32 16
  store ptr %99, ptr %101, align 8, !tbaa !37
  %102 = load ptr, ptr %3, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ggml_opt_context, ptr %102, i32 0, i32 16
  %104 = load ptr, ptr %103, align 8, !tbaa !37
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ggml_opt_context, ptr %105, i32 0, i32 11
  %107 = load ptr, ptr %106, align 8, !tbaa !24
  call void @ggml_build_forward_expand(ptr noundef %104, ptr noundef %107)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !38
  br label %108

108:                                              ; preds = %135, %87
  %109 = load i32, ptr %8, align 4, !tbaa !38
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ggml_opt_context, ptr %110, i32 0, i32 16
  %112 = load ptr, ptr %111, align 8, !tbaa !37
  %113 = getelementptr inbounds %struct.ggml_cgraph, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !39
  %115 = icmp slt i32 %109, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %138

117:                                              ; preds = %108
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ggml_opt_context, ptr %118, i32 0, i32 16
  %120 = load ptr, ptr %119, align 8, !tbaa !37
  %121 = getelementptr inbounds %struct.ggml_cgraph, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !43
  %123 = load i32, ptr %8, align 4, !tbaa !38
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %122, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.ggml_tensor, ptr %126, i32 0, i32 6
  %128 = load i32, ptr %127, align 4, !tbaa !44
  %129 = and i32 %128, 4
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %134

131:                                              ; preds = %117
  %132 = load i32, ptr %7, align 4, !tbaa !38
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %7, align 4, !tbaa !38
  br label %134

134:                                              ; preds = %131, %117
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %8, align 4, !tbaa !38
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %8, align 4, !tbaa !38
  br label %108, !llvm.loop !45

138:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %139 = load i8, ptr %6, align 1, !tbaa !36, !range !47, !noundef !48
  %140 = trunc i8 %139 to i1
  %141 = zext i1 %140 to i64
  %142 = select i1 %140, i32 1, i32 0
  %143 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %144 = load i32, ptr %143, align 4, !tbaa !35
  %145 = icmp eq i32 %144, 2
  %146 = zext i1 %145 to i64
  %147 = select i1 %145, i32 2, i32 0
  %148 = add nsw i32 %142, %147
  %149 = sext i32 %148 to i64
  store i64 %149, ptr %9, align 8, !tbaa !49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %150 = load i64, ptr %9, align 8, !tbaa !49
  %151 = load i32, ptr %7, align 4, !tbaa !38
  %152 = sext i32 %151 to i64
  %153 = mul i64 %150, %152
  %154 = add i64 %153, 9
  %155 = call i64 @ggml_tensor_overhead()
  %156 = mul i64 %154, %155
  store i64 %156, ptr %10, align 8, !tbaa !49
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #8
  %157 = getelementptr inbounds %struct.ggml_init_params, ptr %11, i32 0, i32 0
  %158 = load i64, ptr %10, align 8, !tbaa !49
  store i64 %158, ptr %157, align 8, !tbaa !50
  %159 = getelementptr inbounds %struct.ggml_init_params, ptr %11, i32 0, i32 1
  store ptr null, ptr %159, align 8, !tbaa !52
  %160 = getelementptr inbounds %struct.ggml_init_params, ptr %11, i32 0, i32 2
  store i8 1, ptr %160, align 8, !tbaa !53
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !54
  %161 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %12)
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.ggml_opt_context, ptr %162, i32 0, i32 3
  store ptr %161, ptr %163, align 8, !tbaa !55
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %164 = call i64 @ggml_tensor_overhead()
  %165 = mul i64 1, %164
  store i64 %165, ptr %13, align 8, !tbaa !49
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #8
  %166 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 0
  %167 = load i64, ptr %13, align 8, !tbaa !49
  store i64 %167, ptr %166, align 8, !tbaa !50
  %168 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 1
  store ptr null, ptr %168, align 8, !tbaa !52
  %169 = getelementptr inbounds %struct.ggml_init_params, ptr %14, i32 0, i32 2
  store i8 1, ptr %169, align 8, !tbaa !53
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %14, i64 24, i1 false), !tbaa.struct !54
  %170 = call ptr @ggml_init(ptr noundef byval(%struct.ggml_init_params) align 8 %15)
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ggml_opt_context, ptr %171, i32 0, i32 4
  store ptr %170, ptr %172, align 8, !tbaa !56
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %173 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 4
  %174 = load i32, ptr %173, align 8, !tbaa !57
  switch i32 %174, label %377 [
    i32 0, label %175
    i32 1, label %216
    i32 2, label %232
    i32 3, label %291
  ]

175:                                              ; preds = %138
  %176 = load ptr, ptr %3, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.ggml_opt_context, ptr %176, i32 0, i32 3
  %178 = load ptr, ptr %177, align 8, !tbaa !55
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.ggml_opt_context, ptr %179, i32 0, i32 11
  %181 = load ptr, ptr %180, align 8, !tbaa !24
  %182 = call ptr @ggml_sum(ptr noundef %178, ptr noundef %181)
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.ggml_opt_context, ptr %183, i32 0, i32 13
  store ptr %182, ptr %184, align 8, !tbaa !58
  %185 = load ptr, ptr %3, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.ggml_opt_context, ptr %185, i32 0, i32 13
  %187 = load ptr, ptr %186, align 8, !tbaa !58
  %188 = call ptr @ggml_set_name(ptr noundef %187, ptr noundef @.str.16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ggml_opt_context, ptr %189, i32 0, i32 20
  %191 = load i32, ptr %190, align 8, !tbaa !26
  %192 = sext i32 %191 to i64
  %193 = load ptr, ptr %3, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.ggml_opt_context, ptr %193, i32 0, i32 11
  %195 = load ptr, ptr %194, align 8, !tbaa !24
  %196 = call i64 @ggml_nelements(ptr noundef %195)
  %197 = mul nsw i64 %192, %196
  %198 = sitofp i64 %197 to float
  %199 = fdiv float 1.000000e+00, %198
  store float %199, ptr %16, align 4, !tbaa !59
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ggml_opt_context, ptr %200, i32 0, i32 3
  %202 = load ptr, ptr %201, align 8, !tbaa !55
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.ggml_opt_context, ptr %203, i32 0, i32 13
  %205 = load ptr, ptr %204, align 8, !tbaa !58
  %206 = load float, ptr %16, align 4, !tbaa !59
  %207 = call ptr @ggml_scale(ptr noundef %202, ptr noundef %205, float noundef %206)
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.ggml_opt_context, ptr %208, i32 0, i32 13
  store ptr %207, ptr %209, align 8, !tbaa !58
  %210 = load ptr, ptr %3, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.ggml_opt_context, ptr %210, i32 0, i32 13
  %212 = load ptr, ptr %211, align 8, !tbaa !58
  %213 = call ptr @ggml_set_name(ptr noundef %212, ptr noundef @.str.17)
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.ggml_opt_context, ptr %214, i32 0, i32 22
  store i8 1, ptr %215, align 8, !tbaa !61
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %377

216:                                              ; preds = %138
  %217 = load ptr, ptr %3, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.ggml_opt_context, ptr %217, i32 0, i32 3
  %219 = load ptr, ptr %218, align 8, !tbaa !55
  %220 = load ptr, ptr %3, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.ggml_opt_context, ptr %220, i32 0, i32 11
  %222 = load ptr, ptr %221, align 8, !tbaa !24
  %223 = call ptr @ggml_sum(ptr noundef %219, ptr noundef %222)
  %224 = load ptr, ptr %3, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.ggml_opt_context, ptr %224, i32 0, i32 13
  store ptr %223, ptr %225, align 8, !tbaa !58
  %226 = load ptr, ptr %3, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.ggml_opt_context, ptr %226, i32 0, i32 13
  %228 = load ptr, ptr %227, align 8, !tbaa !58
  %229 = call ptr @ggml_set_name(ptr noundef %228, ptr noundef @.str.16)
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.ggml_opt_context, ptr %230, i32 0, i32 22
  store i8 0, ptr %231, align 8, !tbaa !61
  br label %377

232:                                              ; preds = %138
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.ggml_opt_context, ptr %233, i32 0, i32 3
  %235 = load ptr, ptr %234, align 8, !tbaa !55
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.ggml_opt_context, ptr %236, i32 0, i32 11
  %238 = load ptr, ptr %237, align 8, !tbaa !24
  %239 = call ptr @ggml_dup_tensor(ptr noundef %235, ptr noundef %238)
  %240 = load ptr, ptr %3, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.ggml_opt_context, ptr %240, i32 0, i32 12
  store ptr %239, ptr %241, align 8, !tbaa !62
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.ggml_opt_context, ptr %242, i32 0, i32 12
  %244 = load ptr, ptr %243, align 8, !tbaa !62
  call void @ggml_set_input(ptr noundef %244)
  %245 = load ptr, ptr %3, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.ggml_opt_context, ptr %245, i32 0, i32 12
  %247 = load ptr, ptr %246, align 8, !tbaa !62
  %248 = call ptr @ggml_set_name(ptr noundef %247, ptr noundef @.str.18)
  %249 = load ptr, ptr %3, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.ggml_opt_context, ptr %249, i32 0, i32 3
  %251 = load ptr, ptr %250, align 8, !tbaa !55
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.ggml_opt_context, ptr %252, i32 0, i32 11
  %254 = load ptr, ptr %253, align 8, !tbaa !24
  %255 = load ptr, ptr %3, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.ggml_opt_context, ptr %255, i32 0, i32 12
  %257 = load ptr, ptr %256, align 8, !tbaa !62
  %258 = call ptr @ggml_cross_entropy_loss(ptr noundef %251, ptr noundef %254, ptr noundef %257)
  %259 = load ptr, ptr %3, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.ggml_opt_context, ptr %259, i32 0, i32 13
  store ptr %258, ptr %260, align 8, !tbaa !58
  %261 = load ptr, ptr %3, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.ggml_opt_context, ptr %261, i32 0, i32 13
  %263 = load ptr, ptr %262, align 8, !tbaa !58
  %264 = call ptr @ggml_set_name(ptr noundef %263, ptr noundef @.str.19)
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.ggml_opt_context, ptr %265, i32 0, i32 20
  %267 = load i32, ptr %266, align 8, !tbaa !26
  %268 = icmp sgt i32 %267, 1
  br i1 %268, label %269, label %288

269:                                              ; preds = %232
  %270 = load ptr, ptr %3, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.ggml_opt_context, ptr %270, i32 0, i32 3
  %272 = load ptr, ptr %271, align 8, !tbaa !55
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.ggml_opt_context, ptr %273, i32 0, i32 13
  %275 = load ptr, ptr %274, align 8, !tbaa !58
  %276 = load ptr, ptr %3, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.ggml_opt_context, ptr %276, i32 0, i32 20
  %278 = load i32, ptr %277, align 8, !tbaa !26
  %279 = sitofp i32 %278 to float
  %280 = fdiv float 1.000000e+00, %279
  %281 = call ptr @ggml_scale(ptr noundef %272, ptr noundef %275, float noundef %280)
  %282 = load ptr, ptr %3, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.ggml_opt_context, ptr %282, i32 0, i32 13
  store ptr %281, ptr %283, align 8, !tbaa !58
  %284 = load ptr, ptr %3, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.ggml_opt_context, ptr %284, i32 0, i32 13
  %286 = load ptr, ptr %285, align 8, !tbaa !58
  %287 = call ptr @ggml_set_name(ptr noundef %286, ptr noundef @.str.20)
  br label %288

288:                                              ; preds = %269, %232
  %289 = load ptr, ptr %3, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.ggml_opt_context, ptr %289, i32 0, i32 22
  store i8 1, ptr %290, align 8, !tbaa !61
  br label %377

291:                                              ; preds = %138
  %292 = load ptr, ptr %3, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.ggml_opt_context, ptr %292, i32 0, i32 3
  %294 = load ptr, ptr %293, align 8, !tbaa !55
  %295 = load ptr, ptr %3, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.ggml_opt_context, ptr %295, i32 0, i32 11
  %297 = load ptr, ptr %296, align 8, !tbaa !24
  %298 = call ptr @ggml_dup_tensor(ptr noundef %294, ptr noundef %297)
  %299 = load ptr, ptr %3, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.ggml_opt_context, ptr %299, i32 0, i32 12
  store ptr %298, ptr %300, align 8, !tbaa !62
  %301 = load ptr, ptr %3, align 8, !tbaa !5
  %302 = getelementptr inbounds %struct.ggml_opt_context, ptr %301, i32 0, i32 12
  %303 = load ptr, ptr %302, align 8, !tbaa !62
  call void @ggml_set_input(ptr noundef %303)
  %304 = load ptr, ptr %3, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.ggml_opt_context, ptr %304, i32 0, i32 12
  %306 = load ptr, ptr %305, align 8, !tbaa !62
  %307 = call ptr @ggml_set_name(ptr noundef %306, ptr noundef @.str.18)
  %308 = load ptr, ptr %3, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.ggml_opt_context, ptr %308, i32 0, i32 3
  %310 = load ptr, ptr %309, align 8, !tbaa !55
  %311 = load ptr, ptr %3, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.ggml_opt_context, ptr %311, i32 0, i32 11
  %313 = load ptr, ptr %312, align 8, !tbaa !24
  %314 = load ptr, ptr %3, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.ggml_opt_context, ptr %314, i32 0, i32 12
  %316 = load ptr, ptr %315, align 8, !tbaa !62
  %317 = call ptr @ggml_sub(ptr noundef %310, ptr noundef %313, ptr noundef %316)
  %318 = load ptr, ptr %3, align 8, !tbaa !5
  %319 = getelementptr inbounds %struct.ggml_opt_context, ptr %318, i32 0, i32 13
  store ptr %317, ptr %319, align 8, !tbaa !58
  %320 = load ptr, ptr %3, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.ggml_opt_context, ptr %320, i32 0, i32 13
  %322 = load ptr, ptr %321, align 8, !tbaa !58
  %323 = call ptr @ggml_set_name(ptr noundef %322, ptr noundef @.str.21)
  %324 = load ptr, ptr %3, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.ggml_opt_context, ptr %324, i32 0, i32 3
  %326 = load ptr, ptr %325, align 8, !tbaa !55
  %327 = load ptr, ptr %3, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.ggml_opt_context, ptr %327, i32 0, i32 13
  %329 = load ptr, ptr %328, align 8, !tbaa !58
  %330 = call ptr @ggml_sqr(ptr noundef %326, ptr noundef %329)
  %331 = load ptr, ptr %3, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.ggml_opt_context, ptr %331, i32 0, i32 13
  store ptr %330, ptr %332, align 8, !tbaa !58
  %333 = load ptr, ptr %3, align 8, !tbaa !5
  %334 = getelementptr inbounds %struct.ggml_opt_context, ptr %333, i32 0, i32 13
  %335 = load ptr, ptr %334, align 8, !tbaa !58
  %336 = call ptr @ggml_set_name(ptr noundef %335, ptr noundef @.str.22)
  %337 = load ptr, ptr %3, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct.ggml_opt_context, ptr %337, i32 0, i32 3
  %339 = load ptr, ptr %338, align 8, !tbaa !55
  %340 = load ptr, ptr %3, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.ggml_opt_context, ptr %340, i32 0, i32 13
  %342 = load ptr, ptr %341, align 8, !tbaa !58
  %343 = call ptr @ggml_sum(ptr noundef %339, ptr noundef %342)
  %344 = load ptr, ptr %3, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.ggml_opt_context, ptr %344, i32 0, i32 13
  store ptr %343, ptr %345, align 8, !tbaa !58
  %346 = load ptr, ptr %3, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.ggml_opt_context, ptr %346, i32 0, i32 13
  %348 = load ptr, ptr %347, align 8, !tbaa !58
  %349 = call ptr @ggml_set_name(ptr noundef %348, ptr noundef @.str.23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %350 = load ptr, ptr %3, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.ggml_opt_context, ptr %350, i32 0, i32 20
  %352 = load i32, ptr %351, align 8, !tbaa !26
  %353 = sext i32 %352 to i64
  %354 = load ptr, ptr %3, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.ggml_opt_context, ptr %354, i32 0, i32 11
  %356 = load ptr, ptr %355, align 8, !tbaa !24
  %357 = call i64 @ggml_nelements(ptr noundef %356)
  %358 = mul nsw i64 %353, %357
  %359 = sitofp i64 %358 to float
  %360 = fdiv float 1.000000e+00, %359
  store float %360, ptr %17, align 4, !tbaa !59
  %361 = load ptr, ptr %3, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.ggml_opt_context, ptr %361, i32 0, i32 3
  %363 = load ptr, ptr %362, align 8, !tbaa !55
  %364 = load ptr, ptr %3, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.ggml_opt_context, ptr %364, i32 0, i32 13
  %366 = load ptr, ptr %365, align 8, !tbaa !58
  %367 = load float, ptr %17, align 4, !tbaa !59
  %368 = call ptr @ggml_scale(ptr noundef %363, ptr noundef %366, float noundef %367)
  %369 = load ptr, ptr %3, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.ggml_opt_context, ptr %369, i32 0, i32 13
  store ptr %368, ptr %370, align 8, !tbaa !58
  %371 = load ptr, ptr %3, align 8, !tbaa !5
  %372 = getelementptr inbounds %struct.ggml_opt_context, ptr %371, i32 0, i32 13
  %373 = load ptr, ptr %372, align 8, !tbaa !58
  %374 = call ptr @ggml_set_name(ptr noundef %373, ptr noundef @.str.24)
  %375 = load ptr, ptr %3, align 8, !tbaa !5
  %376 = getelementptr inbounds %struct.ggml_opt_context, ptr %375, i32 0, i32 22
  store i8 1, ptr %376, align 8, !tbaa !61
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %377

377:                                              ; preds = %291, %288, %216, %175, %138
  %378 = load ptr, ptr %3, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.ggml_opt_context, ptr %378, i32 0, i32 13
  %380 = load ptr, ptr %379, align 8, !tbaa !58
  call void @ggml_set_output(ptr noundef %380)
  %381 = load ptr, ptr %3, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct.ggml_opt_context, ptr %381, i32 0, i32 13
  %383 = load ptr, ptr %382, align 8, !tbaa !58
  call void @ggml_set_loss(ptr noundef %383)
  %384 = load ptr, ptr %3, align 8, !tbaa !5
  %385 = getelementptr inbounds %struct.ggml_opt_context, ptr %384, i32 0, i32 16
  %386 = load ptr, ptr %385, align 8, !tbaa !37
  %387 = load ptr, ptr %3, align 8, !tbaa !5
  %388 = getelementptr inbounds %struct.ggml_opt_context, ptr %387, i32 0, i32 13
  %389 = load ptr, ptr %388, align 8, !tbaa !58
  call void @ggml_build_forward_expand(ptr noundef %386, ptr noundef %389)
  %390 = load ptr, ptr %3, align 8, !tbaa !5
  %391 = getelementptr inbounds %struct.ggml_opt_context, ptr %390, i32 0, i32 3
  %392 = load ptr, ptr %391, align 8, !tbaa !55
  %393 = load ptr, ptr %3, align 8, !tbaa !5
  %394 = getelementptr inbounds %struct.ggml_opt_context, ptr %393, i32 0, i32 11
  %395 = load ptr, ptr %394, align 8, !tbaa !24
  %396 = call ptr @ggml_argmax(ptr noundef %392, ptr noundef %395)
  %397 = load ptr, ptr %3, align 8, !tbaa !5
  %398 = getelementptr inbounds %struct.ggml_opt_context, ptr %397, i32 0, i32 14
  store ptr %396, ptr %398, align 8, !tbaa !63
  %399 = load ptr, ptr %3, align 8, !tbaa !5
  %400 = getelementptr inbounds %struct.ggml_opt_context, ptr %399, i32 0, i32 14
  %401 = load ptr, ptr %400, align 8, !tbaa !63
  %402 = call ptr @ggml_set_name(ptr noundef %401, ptr noundef @.str.25)
  %403 = load ptr, ptr %3, align 8, !tbaa !5
  %404 = getelementptr inbounds %struct.ggml_opt_context, ptr %403, i32 0, i32 14
  %405 = load ptr, ptr %404, align 8, !tbaa !63
  call void @ggml_set_output(ptr noundef %405)
  %406 = load ptr, ptr %3, align 8, !tbaa !5
  %407 = getelementptr inbounds %struct.ggml_opt_context, ptr %406, i32 0, i32 16
  %408 = load ptr, ptr %407, align 8, !tbaa !37
  %409 = load ptr, ptr %3, align 8, !tbaa !5
  %410 = getelementptr inbounds %struct.ggml_opt_context, ptr %409, i32 0, i32 14
  %411 = load ptr, ptr %410, align 8, !tbaa !63
  call void @ggml_build_forward_expand(ptr noundef %408, ptr noundef %411)
  %412 = load ptr, ptr %3, align 8, !tbaa !5
  %413 = getelementptr inbounds %struct.ggml_opt_context, ptr %412, i32 0, i32 12
  %414 = load ptr, ptr %413, align 8, !tbaa !62
  %415 = icmp ne ptr %414, null
  br i1 %415, label %416, label %446

416:                                              ; preds = %377
  %417 = load ptr, ptr %3, align 8, !tbaa !5
  %418 = getelementptr inbounds %struct.ggml_opt_context, ptr %417, i32 0, i32 3
  %419 = load ptr, ptr %418, align 8, !tbaa !55
  %420 = load ptr, ptr %3, align 8, !tbaa !5
  %421 = getelementptr inbounds %struct.ggml_opt_context, ptr %420, i32 0, i32 14
  %422 = load ptr, ptr %421, align 8, !tbaa !63
  %423 = load ptr, ptr %3, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.ggml_opt_context, ptr %423, i32 0, i32 3
  %425 = load ptr, ptr %424, align 8, !tbaa !55
  %426 = load ptr, ptr %3, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.ggml_opt_context, ptr %426, i32 0, i32 12
  %428 = load ptr, ptr %427, align 8, !tbaa !62
  %429 = call ptr @ggml_argmax(ptr noundef %425, ptr noundef %428)
  %430 = call ptr @ggml_count_equal(ptr noundef %419, ptr noundef %422, ptr noundef %429)
  %431 = load ptr, ptr %3, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.ggml_opt_context, ptr %431, i32 0, i32 15
  store ptr %430, ptr %432, align 8, !tbaa !64
  %433 = load ptr, ptr %3, align 8, !tbaa !5
  %434 = getelementptr inbounds %struct.ggml_opt_context, ptr %433, i32 0, i32 15
  %435 = load ptr, ptr %434, align 8, !tbaa !64
  %436 = call ptr @ggml_set_name(ptr noundef %435, ptr noundef @.str.26)
  %437 = load ptr, ptr %3, align 8, !tbaa !5
  %438 = getelementptr inbounds %struct.ggml_opt_context, ptr %437, i32 0, i32 15
  %439 = load ptr, ptr %438, align 8, !tbaa !64
  call void @ggml_set_output(ptr noundef %439)
  %440 = load ptr, ptr %3, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.ggml_opt_context, ptr %440, i32 0, i32 16
  %442 = load ptr, ptr %441, align 8, !tbaa !37
  %443 = load ptr, ptr %3, align 8, !tbaa !5
  %444 = getelementptr inbounds %struct.ggml_opt_context, ptr %443, i32 0, i32 15
  %445 = load ptr, ptr %444, align 8, !tbaa !64
  call void @ggml_build_forward_expand(ptr noundef %442, ptr noundef %445)
  br label %449

446:                                              ; preds = %377
  %447 = load ptr, ptr %3, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.ggml_opt_context, ptr %447, i32 0, i32 15
  store ptr null, ptr %448, align 8, !tbaa !64
  br label %449

449:                                              ; preds = %446, %416
  %450 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %451 = load i32, ptr %450, align 4, !tbaa !35
  %452 = icmp eq i32 %451, 0
  br i1 %452, label %453, label %465

453:                                              ; preds = %449
  %454 = load ptr, ptr %3, align 8, !tbaa !5
  %455 = getelementptr inbounds %struct.ggml_opt_context, ptr %454, i32 0, i32 3
  %456 = load ptr, ptr %455, align 8, !tbaa !55
  %457 = load ptr, ptr %3, align 8, !tbaa !5
  %458 = getelementptr inbounds %struct.ggml_opt_context, ptr %457, i32 0, i32 0
  %459 = load ptr, ptr %458, align 8, !tbaa !14
  %460 = call ptr @ggml_backend_sched_get_backend(ptr noundef %459, i32 noundef 0)
  %461 = call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %456, ptr noundef %460)
  %462 = load ptr, ptr %3, align 8, !tbaa !5
  %463 = getelementptr inbounds %struct.ggml_opt_context, ptr %462, i32 0, i32 7
  store ptr %461, ptr %463, align 8, !tbaa !65
  %464 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %464, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %614

465:                                              ; preds = %449
  %466 = load ptr, ptr %3, align 8, !tbaa !5
  %467 = getelementptr inbounds %struct.ggml_opt_context, ptr %466, i32 0, i32 5
  %468 = load ptr, ptr %467, align 8, !tbaa !20
  %469 = load ptr, ptr %3, align 8, !tbaa !5
  %470 = getelementptr inbounds %struct.ggml_opt_context, ptr %469, i32 0, i32 16
  %471 = load ptr, ptr %470, align 8, !tbaa !37
  %472 = call ptr @ggml_graph_dup(ptr noundef %468, ptr noundef %471)
  %473 = load ptr, ptr %3, align 8, !tbaa !5
  %474 = getelementptr inbounds %struct.ggml_opt_context, ptr %473, i32 0, i32 17
  store ptr %472, ptr %474, align 8, !tbaa !66
  %475 = load ptr, ptr %3, align 8, !tbaa !5
  %476 = getelementptr inbounds %struct.ggml_opt_context, ptr %475, i32 0, i32 3
  %477 = load ptr, ptr %476, align 8, !tbaa !55
  %478 = load ptr, ptr %3, align 8, !tbaa !5
  %479 = getelementptr inbounds %struct.ggml_opt_context, ptr %478, i32 0, i32 5
  %480 = load ptr, ptr %479, align 8, !tbaa !20
  %481 = load ptr, ptr %3, align 8, !tbaa !5
  %482 = getelementptr inbounds %struct.ggml_opt_context, ptr %481, i32 0, i32 17
  %483 = load ptr, ptr %482, align 8, !tbaa !66
  %484 = load i8, ptr %6, align 1, !tbaa !36, !range !47, !noundef !48
  %485 = trunc i8 %484 to i1
  call void @ggml_build_backward_expand(ptr noundef %477, ptr noundef %480, ptr noundef %483, i1 noundef zeroext %485)
  %486 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %487 = load i32, ptr %486, align 4, !tbaa !35
  %488 = icmp eq i32 %487, 1
  br i1 %488, label %489, label %504

489:                                              ; preds = %465
  %490 = load ptr, ptr %3, align 8, !tbaa !5
  %491 = getelementptr inbounds %struct.ggml_opt_context, ptr %490, i32 0, i32 3
  %492 = load ptr, ptr %491, align 8, !tbaa !55
  %493 = load ptr, ptr %3, align 8, !tbaa !5
  %494 = getelementptr inbounds %struct.ggml_opt_context, ptr %493, i32 0, i32 0
  %495 = load ptr, ptr %494, align 8, !tbaa !14
  %496 = call ptr @ggml_backend_sched_get_backend(ptr noundef %495, i32 noundef 0)
  %497 = call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %492, ptr noundef %496)
  %498 = load ptr, ptr %3, align 8, !tbaa !5
  %499 = getelementptr inbounds %struct.ggml_opt_context, ptr %498, i32 0, i32 7
  store ptr %497, ptr %499, align 8, !tbaa !65
  %500 = load ptr, ptr %3, align 8, !tbaa !5
  %501 = getelementptr inbounds %struct.ggml_opt_context, ptr %500, i32 0, i32 17
  %502 = load ptr, ptr %501, align 8, !tbaa !66
  call void @ggml_graph_reset(ptr noundef %502)
  %503 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %503, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %614

504:                                              ; preds = %465
  %505 = getelementptr inbounds %struct.ggml_opt_params, ptr %0, i32 0, i32 5
  %506 = load i32, ptr %505, align 4, !tbaa !35
  %507 = icmp eq i32 %506, 2
  br i1 %507, label %509, label %508

508:                                              ; preds = %504
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str, i32 noundef 431, ptr noundef @.str.1, ptr noundef @.str.27) #10
  unreachable

509:                                              ; preds = %504
  %510 = load ptr, ptr %3, align 8, !tbaa !5
  %511 = getelementptr inbounds %struct.ggml_opt_context, ptr %510, i32 0, i32 5
  %512 = load ptr, ptr %511, align 8, !tbaa !20
  %513 = load ptr, ptr %3, align 8, !tbaa !5
  %514 = getelementptr inbounds %struct.ggml_opt_context, ptr %513, i32 0, i32 17
  %515 = load ptr, ptr %514, align 8, !tbaa !66
  %516 = call ptr @ggml_graph_dup(ptr noundef %512, ptr noundef %515)
  %517 = load ptr, ptr %3, align 8, !tbaa !5
  %518 = getelementptr inbounds %struct.ggml_opt_context, ptr %517, i32 0, i32 18
  store ptr %516, ptr %518, align 8, !tbaa !67
  %519 = load ptr, ptr %3, align 8, !tbaa !5
  %520 = getelementptr inbounds %struct.ggml_opt_context, ptr %519, i32 0, i32 4
  %521 = load ptr, ptr %520, align 8, !tbaa !56
  %522 = call ptr @ggml_new_tensor_1d(ptr noundef %521, i32 noundef 0, i64 noundef 7)
  %523 = load ptr, ptr %3, align 8, !tbaa !5
  %524 = getelementptr inbounds %struct.ggml_opt_context, ptr %523, i32 0, i32 25
  store ptr %522, ptr %524, align 8, !tbaa !68
  %525 = load ptr, ptr %3, align 8, !tbaa !5
  %526 = getelementptr inbounds %struct.ggml_opt_context, ptr %525, i32 0, i32 25
  %527 = load ptr, ptr %526, align 8, !tbaa !68
  call void @ggml_set_input(ptr noundef %527)
  %528 = load ptr, ptr %3, align 8, !tbaa !5
  %529 = getelementptr inbounds %struct.ggml_opt_context, ptr %528, i32 0, i32 25
  %530 = load ptr, ptr %529, align 8, !tbaa !68
  %531 = call ptr @ggml_set_name(ptr noundef %530, ptr noundef @.str.28)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %532 = load ptr, ptr %3, align 8, !tbaa !5
  %533 = getelementptr inbounds %struct.ggml_opt_context, ptr %532, i32 0, i32 16
  %534 = load ptr, ptr %533, align 8, !tbaa !37
  %535 = getelementptr inbounds %struct.ggml_cgraph, ptr %534, i32 0, i32 1
  %536 = load i32, ptr %535, align 4, !tbaa !39
  %537 = sub nsw i32 %536, 1
  store i32 %537, ptr %19, align 4, !tbaa !38
  br label %538

538:                                              ; preds = %589, %509
  %539 = load i32, ptr %19, align 4, !tbaa !38
  %540 = icmp sge i32 %539, 0
  br i1 %540, label %542, label %541

541:                                              ; preds = %538
  store i32 6, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %592

542:                                              ; preds = %538
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %543 = load ptr, ptr %3, align 8, !tbaa !5
  %544 = getelementptr inbounds %struct.ggml_opt_context, ptr %543, i32 0, i32 18
  %545 = load ptr, ptr %544, align 8, !tbaa !67
  %546 = getelementptr inbounds %struct.ggml_cgraph, ptr %545, i32 0, i32 3
  %547 = load ptr, ptr %546, align 8, !tbaa !43
  %548 = load i32, ptr %19, align 4, !tbaa !38
  %549 = sext i32 %548 to i64
  %550 = getelementptr inbounds ptr, ptr %547, i64 %549
  %551 = load ptr, ptr %550, align 8, !tbaa !5
  store ptr %551, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %552 = load ptr, ptr %3, align 8, !tbaa !5
  %553 = getelementptr inbounds %struct.ggml_opt_context, ptr %552, i32 0, i32 18
  %554 = load ptr, ptr %553, align 8, !tbaa !67
  %555 = load ptr, ptr %20, align 8, !tbaa !5
  %556 = call ptr @ggml_graph_get_grad(ptr noundef %554, ptr noundef %555)
  store ptr %556, ptr %21, align 8, !tbaa !5
  %557 = load ptr, ptr %20, align 8, !tbaa !5
  %558 = getelementptr inbounds %struct.ggml_tensor, ptr %557, i32 0, i32 6
  %559 = load i32, ptr %558, align 4, !tbaa !44
  %560 = and i32 %559, 4
  %561 = icmp ne i32 %560, 0
  br i1 %561, label %562, label %588

562:                                              ; preds = %542
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %563 = load ptr, ptr %3, align 8, !tbaa !5
  %564 = getelementptr inbounds %struct.ggml_opt_context, ptr %563, i32 0, i32 3
  %565 = load ptr, ptr %564, align 8, !tbaa !55
  %566 = load ptr, ptr %20, align 8, !tbaa !5
  %567 = call ptr @ggml_dup_tensor(ptr noundef %565, ptr noundef %566)
  store ptr %567, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #8
  %568 = load ptr, ptr %3, align 8, !tbaa !5
  %569 = getelementptr inbounds %struct.ggml_opt_context, ptr %568, i32 0, i32 3
  %570 = load ptr, ptr %569, align 8, !tbaa !55
  %571 = load ptr, ptr %20, align 8, !tbaa !5
  %572 = call ptr @ggml_dup_tensor(ptr noundef %570, ptr noundef %571)
  store ptr %572, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %573 = load ptr, ptr %3, align 8, !tbaa !5
  %574 = getelementptr inbounds %struct.ggml_opt_context, ptr %573, i32 0, i32 5
  %575 = load ptr, ptr %574, align 8, !tbaa !20
  %576 = load ptr, ptr %20, align 8, !tbaa !5
  %577 = load ptr, ptr %21, align 8, !tbaa !5
  %578 = load ptr, ptr %22, align 8, !tbaa !5
  %579 = load ptr, ptr %23, align 8, !tbaa !5
  %580 = load ptr, ptr %3, align 8, !tbaa !5
  %581 = getelementptr inbounds %struct.ggml_opt_context, ptr %580, i32 0, i32 25
  %582 = load ptr, ptr %581, align 8, !tbaa !68
  %583 = call ptr @ggml_opt_step_adamw(ptr noundef %575, ptr noundef %576, ptr noundef %577, ptr noundef %578, ptr noundef %579, ptr noundef %582)
  store ptr %583, ptr %24, align 8, !tbaa !5
  %584 = load ptr, ptr %3, align 8, !tbaa !5
  %585 = getelementptr inbounds %struct.ggml_opt_context, ptr %584, i32 0, i32 18
  %586 = load ptr, ptr %585, align 8, !tbaa !67
  %587 = load ptr, ptr %24, align 8, !tbaa !5
  call void @ggml_build_forward_expand(ptr noundef %586, ptr noundef %587)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %588

588:                                              ; preds = %562, %542
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %589

589:                                              ; preds = %588
  %590 = load i32, ptr %19, align 4, !tbaa !38
  %591 = add nsw i32 %590, -1
  store i32 %591, ptr %19, align 4, !tbaa !38
  br label %538, !llvm.loop !69

592:                                              ; preds = %541
  %593 = load ptr, ptr %3, align 8, !tbaa !5
  %594 = getelementptr inbounds %struct.ggml_opt_context, ptr %593, i32 0, i32 3
  %595 = load ptr, ptr %594, align 8, !tbaa !55
  %596 = load ptr, ptr %3, align 8, !tbaa !5
  %597 = getelementptr inbounds %struct.ggml_opt_context, ptr %596, i32 0, i32 0
  %598 = load ptr, ptr %597, align 8, !tbaa !14
  %599 = call ptr @ggml_backend_sched_get_backend(ptr noundef %598, i32 noundef 0)
  %600 = call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %595, ptr noundef %599)
  %601 = load ptr, ptr %3, align 8, !tbaa !5
  %602 = getelementptr inbounds %struct.ggml_opt_context, ptr %601, i32 0, i32 7
  store ptr %600, ptr %602, align 8, !tbaa !65
  %603 = load ptr, ptr %3, align 8, !tbaa !5
  %604 = getelementptr inbounds %struct.ggml_opt_context, ptr %603, i32 0, i32 4
  %605 = load ptr, ptr %604, align 8, !tbaa !56
  %606 = call ptr @ggml_backend_cpu_buffer_type()
  %607 = call ptr @ggml_backend_alloc_ctx_tensors_from_buft(ptr noundef %605, ptr noundef %606)
  %608 = load ptr, ptr %3, align 8, !tbaa !5
  %609 = getelementptr inbounds %struct.ggml_opt_context, ptr %608, i32 0, i32 8
  store ptr %607, ptr %609, align 8, !tbaa !70
  %610 = load ptr, ptr %3, align 8, !tbaa !5
  %611 = getelementptr inbounds %struct.ggml_opt_context, ptr %610, i32 0, i32 18
  %612 = load ptr, ptr %611, align 8, !tbaa !67
  call void @ggml_graph_reset(ptr noundef %612)
  %613 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %613, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %614

614:                                              ; preds = %592, %489, %453
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  %615 = load ptr, ptr %2, align 8
  ret ptr %615

616:                                              ; preds = %62
  %617 = load ptr, ptr %4, align 8
  %618 = load i32, ptr %5, align 4
  %619 = insertvalue { ptr, i32 } poison, ptr %617, 0
  %620 = insertvalue { ptr, i32 } %619, i32 %618, 1
  resume { ptr, i32 } %620
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16ggml_opt_contextC2Ev(ptr noundef nonnull align 8 dereferenceable(5192)) unnamed_addr #7 align 2

declare i32 @__gxx_personality_v0(...)

declare void @ggml_set_input(ptr noundef) #3

declare void @ggml_set_output(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_sum(ptr noundef, ptr noundef) #3

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

declare i64 @ggml_nelements(ptr noundef) #3

declare ptr @ggml_scale(ptr noundef, ptr noundef, float noundef) #3

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

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

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

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

declare void @ggml_set_loss(ptr noundef) #3

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

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

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

declare ptr @ggml_backend_sched_get_backend(ptr noundef, i32 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 void @ggml_graph_reset(ptr noundef) #3

declare ptr @ggml_new_tensor_1d(ptr noundef, i32 noundef, i64 noundef) #3

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin allocsize(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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nobuiltin 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 #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 = { inlinehint 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 = { builtin allocsize(0) }
attributes #10 = { noreturn }
attributes #11 = { builtin 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, !6, i64 0}
!10 = !{!"_ZTS15ggml_opt_params", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !12, i64 36, !13, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"_ZTS18ggml_opt_loss_type", !7, i64 0}
!12 = !{!"_ZTS19ggml_opt_build_type", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS16ggml_opt_context", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !16, i64 72, !6, i64 5072, !6, i64 5080, !6, i64 5088, !6, i64 5096, !6, i64 5104, !6, i64 5112, !6, i64 5120, !6, i64 5128, !6, i64 5136, !17, i64 5144, !13, i64 5152, !13, i64 5156, !18, i64 5160, !6, i64 5168, !6, i64 5176, !6, i64 5184}
!16 = !{!"_ZTSSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE", !7, i64 0, !17, i64 4992}
!17 = !{!"long", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !6, i64 8}
!20 = !{!15, !6, i64 40}
!21 = !{!10, !6, i64 16}
!22 = !{!15, !6, i64 5072}
!23 = !{!10, !6, i64 24}
!24 = !{!15, !6, i64 5080}
!25 = !{!10, !13, i64 40}
!26 = !{!15, !13, i64 5152}
!27 = !{!10, !6, i64 48}
!28 = !{!15, !6, i64 5168}
!29 = !{!10, !6, i64 56}
!30 = !{!15, !6, i64 5176}
!31 = !{!32, !6, i64 248}
!32 = !{!"_ZTS11ggml_tensor", !33, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !34, i64 80, !7, i64 84, !13, i64 148, !7, i64 152, !6, i64 232, !17, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!33 = !{!"_ZTS9ggml_type", !7, i64 0}
!34 = !{!"_ZTS7ggml_op", !7, i64 0}
!35 = !{!10, !12, i64 36}
!36 = !{!18, !18, i64 0}
!37 = !{!15, !6, i64 5120}
!38 = !{!13, !13, i64 0}
!39 = !{!40, !13, i64 4}
!40 = !{!"_ZTS11ggml_cgraph", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !41, i64 48, !42, i64 72}
!41 = !{!"_ZTS13ggml_hash_set", !17, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!"_ZTS22ggml_cgraph_eval_order", !7, i64 0}
!43 = !{!40, !6, i64 16}
!44 = !{!32, !13, i64 148}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{i8 0, i8 2}
!48 = !{}
!49 = !{!17, !17, i64 0}
!50 = !{!51, !17, i64 0}
!51 = !{!"_ZTS16ggml_init_params", !17, i64 0, !6, i64 8, !18, i64 16}
!52 = !{!51, !6, i64 8}
!53 = !{!51, !18, i64 16}
!54 = !{i64 0, i64 8, !49, i64 8, i64 8, !5, i64 16, i64 1, !36}
!55 = !{!15, !6, i64 24}
!56 = !{!15, !6, i64 32}
!57 = !{!10, !11, i64 32}
!58 = !{!15, !6, i64 5096}
!59 = !{!60, !60, i64 0}
!60 = !{!"float", !7, i64 0}
!61 = !{!15, !18, i64 5160}
!62 = !{!15, !6, i64 5088}
!63 = !{!15, !6, i64 5104}
!64 = !{!15, !6, i64 5112}
!65 = !{!15, !6, i64 56}
!66 = !{!15, !6, i64 5128}
!67 = !{!15, !6, i64 5136}
!68 = !{!15, !6, i64 5184}
!69 = distinct !{!69, !46}
!70 = !{!15, !6, i64 64}


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

%struct.ggml_init_params = type { i64, ptr, i8 }
%struct.ggml_opt_params = type { ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [13 x i8], align 1

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

declare i64 @ggml_tensor_overhead() local_unnamed_addr #2

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

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

declare ptr @ggml_backend_cpu_buffer_type() local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @ggml_opt_init(ptr nocapture noundef readonly byval(%struct.ggml_opt_params) align 8 %0) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.ggml_init_params, align 8
  %3 = alloca %struct.ggml_init_params, align 8
  %4 = tail call noalias noundef nonnull dereferenceable(5192) ptr @_Znwm(i64 noundef 5192) #6
  invoke void @_ZN16ggml_opt_contextC2Ev(ptr noundef nonnull align 8 dereferenceable(5192) %4)
          to label %5 unwind label %25

5:                                                ; preds = %1
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  store ptr %6, ptr %4, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr %8, ptr %9, align 8, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %4, i64 5072
  store ptr %11, ptr %12, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !22
  %15 = getelementptr inbounds i8, ptr %4, i64 5080
  store ptr %14, ptr %15, align 8, !tbaa !23
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = load i32, ptr %16, align 8, !tbaa !24
  %18 = getelementptr inbounds i8, ptr %4, i64 5152
  store i32 %17, ptr %18, align 8, !tbaa !25
  %19 = getelementptr inbounds i8, ptr %0, i64 48
  %20 = getelementptr inbounds i8, ptr %4, i64 5168
  %21 = load <2 x ptr>, ptr %19, align 8, !tbaa !26
  store <2 x ptr> %21, ptr %20, align 8, !tbaa !26
  %22 = getelementptr inbounds i8, ptr %11, i64 248
  %23 = load ptr, ptr %22, align 8, !tbaa !27
  %.not = icmp eq ptr %23, null
  br i1 %.not, label %24, label %27

24:                                               ; preds = %5
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 303, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.14) #7
  unreachable

25:                                               ; preds = %1
  %26 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %4, i64 noundef 5192) #8
  resume { ptr, i32 } %26

27:                                               ; preds = %5
  %28 = icmp sgt i32 %17, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %27
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 304, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.15) #7
  unreachable

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %0, i64 36
  %32 = load i32, ptr %31, align 4, !tbaa !31
  switch i32 %32, label %.fold.split [
    i32 1, label %35
    i32 2, label %33
  ]

33:                                               ; preds = %30
  %34 = icmp ne i32 %17, 1
  br label %35

.fold.split:                                      ; preds = %30
  br label %35

35:                                               ; preds = %30, %.fold.split, %33
  %36 = phi i1 [ true, %30 ], [ %34, %33 ], [ false, %.fold.split ]
  tail call void @ggml_set_input(ptr noundef nonnull %11)
  %37 = load ptr, ptr %15, align 8, !tbaa !23
  tail call void @ggml_set_output(ptr noundef %37)
  %38 = load ptr, ptr %9, align 8, !tbaa !19
  %39 = tail call ptr @ggml_new_graph_custom(ptr noundef %38, i64 noundef 2048, i1 noundef zeroext true)
  %40 = getelementptr inbounds i8, ptr %4, i64 5120
  store ptr %39, ptr %40, align 8, !tbaa !32
  %41 = load ptr, ptr %15, align 8, !tbaa !23
  tail call void @ggml_build_forward_expand(ptr noundef %39, ptr noundef %41)
  %42 = load ptr, ptr %40, align 8, !tbaa !32
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !33
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %35
  %46 = getelementptr inbounds i8, ptr %42, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !37
  %wide.trip.count = zext nneg i32 %44 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %48 = icmp ult i32 %44, 4
  br i1 %48, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %71

._crit_edge.loopexit.unr-lcssa:                   ; preds = %71, %.lr.ph
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph ], [ %spec.select.3, %71 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %71 ]
  %.0167178.unr = phi i32 [ 0, %.lr.ph ], [ %spec.select.3, %71 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge.loopexit, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.0167178.epil = phi i32 [ %spec.select.epil, %.epil.preheader ], [ %.0167178.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %49 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv.epil
  %50 = load ptr, ptr %49, align 8, !tbaa !26
  %51 = getelementptr inbounds i8, ptr %50, i64 148
  %52 = load i32, ptr %51, align 4, !tbaa !38
  %53 = lshr i32 %52, 2
  %54 = and i32 %53, 1
  %spec.select.epil = add i32 %54, %.0167178.epil
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge.loopexit, label %.epil.preheader, !llvm.loop !39

._crit_edge.loopexit:                             ; preds = %.epil.preheader, %._crit_edge.loopexit.unr-lcssa
  %spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %spec.select.epil, %.epil.preheader ]
  %55 = sext i32 %spec.select.lcssa to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %35
  %.0167.lcssa = phi i64 [ 0, %35 ], [ %55, %._crit_edge.loopexit ]
  %56 = zext i1 %36 to i64
  %57 = icmp eq i32 %32, 2
  %58 = select i1 %57, i64 2, i64 0
  %59 = or disjoint i64 %58, %56
  %60 = mul nsw i64 %59, %.0167.lcssa
  %61 = add nsw i64 %60, 9
  %62 = tail call i64 @ggml_tensor_overhead()
  %63 = mul i64 %62, %61
  store i64 %63, ptr %2, align 8, !tbaa !41
  %.sroa.415.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 8
  store ptr null, ptr %.sroa.415.0..sroa_idx, align 8, !tbaa !26
  %.sroa.516.0..sroa_idx = getelementptr inbounds i8, ptr %2, i64 16
  store i8 1, ptr %.sroa.516.0..sroa_idx, align 8, !tbaa !42
  %64 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %2)
  %65 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr %64, ptr %65, align 8, !tbaa !43
  %66 = tail call i64 @ggml_tensor_overhead()
  store i64 %66, ptr %3, align 8, !tbaa !41
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 8
  store ptr null, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !26
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 16
  store i8 1, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !42
  %67 = tail call ptr @ggml_init(ptr noundef nonnull byval(%struct.ggml_init_params) align 8 %3)
  %68 = getelementptr inbounds i8, ptr %4, i64 32
  store ptr %67, ptr %68, align 8, !tbaa !44
  %69 = getelementptr inbounds i8, ptr %0, i64 32
  %70 = load i32, ptr %69, align 8, !tbaa !45
  switch i32 %70, label %174 [
    i32 0, label %96
    i32 1, label %113
    i32 2, label %119
    i32 3, label %141
  ]

71:                                               ; preds = %71, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %71 ]
  %.0167178 = phi i32 [ 0, %.lr.ph.new ], [ %spec.select.3, %71 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %71 ]
  %72 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  %74 = getelementptr inbounds i8, ptr %73, i64 148
  %75 = load i32, ptr %74, align 4, !tbaa !38
  %76 = lshr i32 %75, 2
  %77 = and i32 %76, 1
  %spec.select = add i32 %77, %.0167178
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %78 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv.next
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  %80 = getelementptr inbounds i8, ptr %79, i64 148
  %81 = load i32, ptr %80, align 4, !tbaa !38
  %82 = lshr i32 %81, 2
  %83 = and i32 %82, 1
  %spec.select.1 = add i32 %83, %spec.select
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %84 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv.next.1
  %85 = load ptr, ptr %84, align 8, !tbaa !26
  %86 = getelementptr inbounds i8, ptr %85, i64 148
  %87 = load i32, ptr %86, align 4, !tbaa !38
  %88 = lshr i32 %87, 2
  %89 = and i32 %88, 1
  %spec.select.2 = add i32 %89, %spec.select.1
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %90 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv.next.2
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = getelementptr inbounds i8, ptr %91, i64 148
  %93 = load i32, ptr %92, align 4, !tbaa !38
  %94 = lshr i32 %93, 2
  %95 = and i32 %94, 1
  %spec.select.3 = add i32 %95, %spec.select.2
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %71, !llvm.loop !46

96:                                               ; preds = %._crit_edge
  %97 = load ptr, ptr %65, align 8, !tbaa !43
  %98 = load ptr, ptr %15, align 8, !tbaa !23
  %99 = tail call ptr @ggml_sum(ptr noundef %97, ptr noundef %98)
  %100 = getelementptr inbounds i8, ptr %4, i64 5096
  store ptr %99, ptr %100, align 8, !tbaa !48
  %101 = tail call ptr @ggml_set_name(ptr noundef %99, ptr noundef nonnull @.str.16)
  %102 = load i32, ptr %18, align 8, !tbaa !25
  %103 = sext i32 %102 to i64
  %104 = load ptr, ptr %15, align 8, !tbaa !23
  %105 = tail call i64 @ggml_nelements(ptr noundef %104)
  %106 = mul nsw i64 %105, %103
  %107 = sitofp i64 %106 to float
  %108 = fdiv float 1.000000e+00, %107
  %109 = load ptr, ptr %65, align 8, !tbaa !43
  %110 = load ptr, ptr %100, align 8, !tbaa !48
  %111 = tail call ptr @ggml_scale(ptr noundef %109, ptr noundef %110, float noundef %108)
  store ptr %111, ptr %100, align 8, !tbaa !48
  %112 = tail call ptr @ggml_set_name(ptr noundef %111, ptr noundef nonnull @.str.17)
  br label %.sink.split

113:                                              ; preds = %._crit_edge
  %114 = load ptr, ptr %65, align 8, !tbaa !43
  %115 = load ptr, ptr %15, align 8, !tbaa !23
  %116 = tail call ptr @ggml_sum(ptr noundef %114, ptr noundef %115)
  %117 = getelementptr inbounds i8, ptr %4, i64 5096
  store ptr %116, ptr %117, align 8, !tbaa !48
  %118 = tail call ptr @ggml_set_name(ptr noundef %116, ptr noundef nonnull @.str.16)
  br label %.sink.split

119:                                              ; preds = %._crit_edge
  %120 = load ptr, ptr %65, align 8, !tbaa !43
  %121 = load ptr, ptr %15, align 8, !tbaa !23
  %122 = tail call ptr @ggml_dup_tensor(ptr noundef %120, ptr noundef %121)
  %123 = getelementptr inbounds i8, ptr %4, i64 5088
  store ptr %122, ptr %123, align 8, !tbaa !49
  tail call void @ggml_set_input(ptr noundef %122)
  %124 = load ptr, ptr %123, align 8, !tbaa !49
  %125 = tail call ptr @ggml_set_name(ptr noundef %124, ptr noundef nonnull @.str.18)
  %126 = load ptr, ptr %65, align 8, !tbaa !43
  %127 = load ptr, ptr %15, align 8, !tbaa !23
  %128 = load ptr, ptr %123, align 8, !tbaa !49
  %129 = tail call ptr @ggml_cross_entropy_loss(ptr noundef %126, ptr noundef %127, ptr noundef %128)
  %130 = getelementptr inbounds i8, ptr %4, i64 5096
  store ptr %129, ptr %130, align 8, !tbaa !48
  %131 = tail call ptr @ggml_set_name(ptr noundef %129, ptr noundef nonnull @.str.19)
  %132 = load i32, ptr %18, align 8, !tbaa !25
  %133 = icmp sgt i32 %132, 1
  br i1 %133, label %134, label %.sink.split

134:                                              ; preds = %119
  %135 = load ptr, ptr %65, align 8, !tbaa !43
  %136 = load ptr, ptr %130, align 8, !tbaa !48
  %137 = uitofp nneg i32 %132 to float
  %138 = fdiv float 1.000000e+00, %137
  %139 = tail call ptr @ggml_scale(ptr noundef %135, ptr noundef %136, float noundef %138)
  store ptr %139, ptr %130, align 8, !tbaa !48
  %140 = tail call ptr @ggml_set_name(ptr noundef %139, ptr noundef nonnull @.str.20)
  br label %.sink.split

141:                                              ; preds = %._crit_edge
  %142 = load ptr, ptr %65, align 8, !tbaa !43
  %143 = load ptr, ptr %15, align 8, !tbaa !23
  %144 = tail call ptr @ggml_dup_tensor(ptr noundef %142, ptr noundef %143)
  %145 = getelementptr inbounds i8, ptr %4, i64 5088
  store ptr %144, ptr %145, align 8, !tbaa !49
  tail call void @ggml_set_input(ptr noundef %144)
  %146 = load ptr, ptr %145, align 8, !tbaa !49
  %147 = tail call ptr @ggml_set_name(ptr noundef %146, ptr noundef nonnull @.str.18)
  %148 = load ptr, ptr %65, align 8, !tbaa !43
  %149 = load ptr, ptr %15, align 8, !tbaa !23
  %150 = load ptr, ptr %145, align 8, !tbaa !49
  %151 = tail call ptr @ggml_sub(ptr noundef %148, ptr noundef %149, ptr noundef %150)
  %152 = getelementptr inbounds i8, ptr %4, i64 5096
  store ptr %151, ptr %152, align 8, !tbaa !48
  %153 = tail call ptr @ggml_set_name(ptr noundef %151, ptr noundef nonnull @.str.21)
  %154 = load ptr, ptr %65, align 8, !tbaa !43
  %155 = load ptr, ptr %152, align 8, !tbaa !48
  %156 = tail call ptr @ggml_sqr(ptr noundef %154, ptr noundef %155)
  store ptr %156, ptr %152, align 8, !tbaa !48
  %157 = tail call ptr @ggml_set_name(ptr noundef %156, ptr noundef nonnull @.str.22)
  %158 = load ptr, ptr %65, align 8, !tbaa !43
  %159 = load ptr, ptr %152, align 8, !tbaa !48
  %160 = tail call ptr @ggml_sum(ptr noundef %158, ptr noundef %159)
  store ptr %160, ptr %152, align 8, !tbaa !48
  %161 = tail call ptr @ggml_set_name(ptr noundef %160, ptr noundef nonnull @.str.23)
  %162 = load i32, ptr %18, align 8, !tbaa !25
  %163 = sext i32 %162 to i64
  %164 = load ptr, ptr %15, align 8, !tbaa !23
  %165 = tail call i64 @ggml_nelements(ptr noundef %164)
  %166 = mul nsw i64 %165, %163
  %167 = sitofp i64 %166 to float
  %168 = fdiv float 1.000000e+00, %167
  %169 = load ptr, ptr %65, align 8, !tbaa !43
  %170 = load ptr, ptr %152, align 8, !tbaa !48
  %171 = tail call ptr @ggml_scale(ptr noundef %169, ptr noundef %170, float noundef %168)
  store ptr %171, ptr %152, align 8, !tbaa !48
  %172 = tail call ptr @ggml_set_name(ptr noundef %171, ptr noundef nonnull @.str.24)
  br label %.sink.split

.sink.split:                                      ; preds = %119, %134, %96, %113, %141
  %.sink = phi i8 [ 1, %141 ], [ 0, %113 ], [ 1, %96 ], [ 1, %134 ], [ 1, %119 ]
  %173 = getelementptr inbounds i8, ptr %4, i64 5160
  store i8 %.sink, ptr %173, align 8, !tbaa !50
  br label %174

174:                                              ; preds = %.sink.split, %._crit_edge
  %175 = getelementptr inbounds i8, ptr %4, i64 5096
  %176 = load ptr, ptr %175, align 8, !tbaa !48
  tail call void @ggml_set_output(ptr noundef %176)
  %177 = load ptr, ptr %175, align 8, !tbaa !48
  tail call void @ggml_set_loss(ptr noundef %177)
  %178 = load ptr, ptr %40, align 8, !tbaa !32
  %179 = load ptr, ptr %175, align 8, !tbaa !48
  tail call void @ggml_build_forward_expand(ptr noundef %178, ptr noundef %179)
  %180 = load ptr, ptr %65, align 8, !tbaa !43
  %181 = load ptr, ptr %15, align 8, !tbaa !23
  %182 = tail call ptr @ggml_argmax(ptr noundef %180, ptr noundef %181)
  %183 = getelementptr inbounds i8, ptr %4, i64 5104
  store ptr %182, ptr %183, align 8, !tbaa !51
  %184 = tail call ptr @ggml_set_name(ptr noundef %182, ptr noundef nonnull @.str.25)
  %185 = load ptr, ptr %183, align 8, !tbaa !51
  tail call void @ggml_set_output(ptr noundef %185)
  %186 = load ptr, ptr %40, align 8, !tbaa !32
  %187 = load ptr, ptr %183, align 8, !tbaa !51
  tail call void @ggml_build_forward_expand(ptr noundef %186, ptr noundef %187)
  %188 = getelementptr inbounds i8, ptr %4, i64 5088
  %189 = load ptr, ptr %188, align 8, !tbaa !49
  %.not174 = icmp eq ptr %189, null
  br i1 %.not174, label %200, label %190

190:                                              ; preds = %174
  %191 = load ptr, ptr %65, align 8, !tbaa !43
  %192 = load ptr, ptr %183, align 8, !tbaa !51
  %193 = tail call ptr @ggml_argmax(ptr noundef %191, ptr noundef nonnull %189)
  %194 = tail call ptr @ggml_count_equal(ptr noundef %191, ptr noundef %192, ptr noundef %193)
  %195 = getelementptr inbounds i8, ptr %4, i64 5112
  store ptr %194, ptr %195, align 8, !tbaa !52
  %196 = tail call ptr @ggml_set_name(ptr noundef %194, ptr noundef nonnull @.str.26)
  %197 = load ptr, ptr %195, align 8, !tbaa !52
  tail call void @ggml_set_output(ptr noundef %197)
  %198 = load ptr, ptr %40, align 8, !tbaa !32
  %199 = load ptr, ptr %195, align 8, !tbaa !52
  tail call void @ggml_build_forward_expand(ptr noundef %198, ptr noundef %199)
  br label %202

200:                                              ; preds = %174
  %201 = getelementptr inbounds i8, ptr %4, i64 5112
  store ptr null, ptr %201, align 8, !tbaa !52
  br label %202

202:                                              ; preds = %200, %190
  %203 = icmp eq i32 %32, 0
  br i1 %203, label %204, label %210

204:                                              ; preds = %202
  %205 = load ptr, ptr %65, align 8, !tbaa !43
  %206 = load ptr, ptr %4, align 8, !tbaa !13
  %207 = tail call ptr @ggml_backend_sched_get_backend(ptr noundef %206, i32 noundef 0)
  %208 = tail call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %205, ptr noundef %207)
  %209 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %208, ptr %209, align 8, !tbaa !53
  br label %270

210:                                              ; preds = %202
  %211 = load ptr, ptr %9, align 8, !tbaa !19
  %212 = load ptr, ptr %40, align 8, !tbaa !32
  %213 = tail call ptr @ggml_graph_dup(ptr noundef %211, ptr noundef %212)
  %214 = getelementptr inbounds i8, ptr %4, i64 5128
  store ptr %213, ptr %214, align 8, !tbaa !54
  %215 = load ptr, ptr %65, align 8, !tbaa !43
  %216 = load ptr, ptr %9, align 8, !tbaa !19
  tail call void @ggml_build_backward_expand(ptr noundef %215, ptr noundef %216, ptr noundef %213, i1 noundef zeroext %36)
  switch i32 %32, label %224 [
    i32 1, label %217
    i32 2, label %225
  ]

217:                                              ; preds = %210
  %218 = load ptr, ptr %65, align 8, !tbaa !43
  %219 = load ptr, ptr %4, align 8, !tbaa !13
  %220 = tail call ptr @ggml_backend_sched_get_backend(ptr noundef %219, i32 noundef 0)
  %221 = tail call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %218, ptr noundef %220)
  %222 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %221, ptr %222, align 8, !tbaa !53
  %223 = load ptr, ptr %214, align 8, !tbaa !54
  tail call void @ggml_graph_reset(ptr noundef %223)
  br label %270

224:                                              ; preds = %210
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str, i32 noundef 431, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.27) #7
  unreachable

225:                                              ; preds = %210
  %226 = load ptr, ptr %9, align 8, !tbaa !19
  %227 = load ptr, ptr %214, align 8, !tbaa !54
  %228 = tail call ptr @ggml_graph_dup(ptr noundef %226, ptr noundef %227)
  %229 = getelementptr inbounds i8, ptr %4, i64 5136
  store ptr %228, ptr %229, align 8, !tbaa !55
  %230 = load ptr, ptr %68, align 8, !tbaa !44
  %231 = tail call ptr @ggml_new_tensor_1d(ptr noundef %230, i32 noundef 0, i64 noundef 7)
  %232 = getelementptr inbounds i8, ptr %4, i64 5184
  store ptr %231, ptr %232, align 8, !tbaa !56
  tail call void @ggml_set_input(ptr noundef %231)
  %233 = load ptr, ptr %232, align 8, !tbaa !56
  %234 = tail call ptr @ggml_set_name(ptr noundef %233, ptr noundef nonnull @.str.28)
  %235 = load ptr, ptr %40, align 8, !tbaa !32
  %236 = getelementptr inbounds i8, ptr %235, i64 4
  %237 = load i32, ptr %236, align 4, !tbaa !33
  %238 = icmp sgt i32 %237, 0
  br i1 %238, label %.lr.ph182.preheader, label %._crit_edge183

.lr.ph182.preheader:                              ; preds = %225
  %239 = zext nneg i32 %237 to i64
  br label %.lr.ph182

._crit_edge183:                                   ; preds = %268, %225
  %240 = load ptr, ptr %65, align 8, !tbaa !43
  %241 = load ptr, ptr %4, align 8, !tbaa !13
  %242 = tail call ptr @ggml_backend_sched_get_backend(ptr noundef %241, i32 noundef 0)
  %243 = tail call ptr @ggml_backend_alloc_ctx_tensors(ptr noundef %240, ptr noundef %242)
  %244 = getelementptr inbounds i8, ptr %4, i64 56
  store ptr %243, ptr %244, align 8, !tbaa !53
  %245 = load ptr, ptr %68, align 8, !tbaa !44
  %246 = tail call ptr @ggml_backend_cpu_buffer_type()
  %247 = tail call ptr @ggml_backend_alloc_ctx_tensors_from_buft(ptr noundef %245, ptr noundef %246)
  %248 = getelementptr inbounds i8, ptr %4, i64 64
  store ptr %247, ptr %248, align 8, !tbaa !57
  %249 = load ptr, ptr %229, align 8, !tbaa !55
  tail call void @ggml_graph_reset(ptr noundef %249)
  br label %270

.lr.ph182:                                        ; preds = %.lr.ph182.preheader, %268
  %indvars.iv185 = phi i64 [ %239, %.lr.ph182.preheader ], [ %indvars.iv.next186, %268 ]
  %indvars.iv.next186 = add nsw i64 %indvars.iv185, -1
  %250 = load ptr, ptr %229, align 8, !tbaa !55
  %251 = getelementptr inbounds i8, ptr %250, i64 16
  %252 = load ptr, ptr %251, align 8, !tbaa !37
  %253 = getelementptr inbounds ptr, ptr %252, i64 %indvars.iv.next186
  %254 = load ptr, ptr %253, align 8, !tbaa !26
  %255 = tail call ptr @ggml_graph_get_grad(ptr noundef %250, ptr noundef %254)
  %256 = getelementptr inbounds i8, ptr %254, i64 148
  %257 = load i32, ptr %256, align 4, !tbaa !38
  %258 = and i32 %257, 4
  %.not175 = icmp eq i32 %258, 0
  br i1 %.not175, label %268, label %259

259:                                              ; preds = %.lr.ph182
  %260 = load ptr, ptr %65, align 8, !tbaa !43
  %261 = tail call ptr @ggml_dup_tensor(ptr noundef %260, ptr noundef nonnull %254)
  %262 = load ptr, ptr %65, align 8, !tbaa !43
  %263 = tail call ptr @ggml_dup_tensor(ptr noundef %262, ptr noundef nonnull %254)
  %264 = load ptr, ptr %9, align 8, !tbaa !19
  %265 = load ptr, ptr %232, align 8, !tbaa !56
  %266 = tail call ptr @ggml_opt_step_adamw(ptr noundef %264, ptr noundef nonnull %254, ptr noundef %255, ptr noundef %261, ptr noundef %263, ptr noundef %265)
  %267 = load ptr, ptr %229, align 8, !tbaa !55
  tail call void @ggml_build_forward_expand(ptr noundef %267, ptr noundef %266)
  br label %268

268:                                              ; preds = %259, %.lr.ph182
  %269 = icmp ugt i64 %indvars.iv185, 1
  br i1 %269, label %.lr.ph182, label %._crit_edge183, !llvm.loop !58

270:                                              ; preds = %._crit_edge183, %217, %204
  ret ptr %4
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16ggml_opt_contextC2Ev(ptr noundef nonnull align 8 dereferenceable(5192)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

declare void @ggml_set_input(ptr noundef) local_unnamed_addr #2

declare void @ggml_set_output(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_sum(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i64 @ggml_nelements(ptr noundef) local_unnamed_addr #2

declare ptr @ggml_scale(ptr noundef, ptr noundef, float noundef) local_unnamed_addr #2

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

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

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

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

declare void @ggml_set_loss(ptr noundef) local_unnamed_addr #2

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

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

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

declare ptr @ggml_backend_sched_get_backend(ptr noundef, i32 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 void @ggml_graph_reset(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS15ggml_opt_params", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !11, i64 36, !12, i64 40, !7, i64 48, !7, i64 56}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS18ggml_opt_loss_type", !8, i64 0}
!11 = !{!"_ZTS19ggml_opt_build_type", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ZTS16ggml_opt_context", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !15, i64 72, !7, i64 5072, !7, i64 5080, !7, i64 5088, !7, i64 5096, !7, i64 5104, !7, i64 5112, !7, i64 5120, !7, i64 5128, !7, i64 5136, !16, i64 5144, !12, i64 5152, !12, i64 5156, !17, i64 5160, !7, i64 5168, !7, i64 5176, !7, i64 5184}
!15 = !{!"_ZTSSt23mersenne_twister_engineImLm32ELm624ELm397ELm31ELm2567483615ELm11ELm4294967295ELm7ELm2636928640ELm15ELm4022730752ELm18ELm1812433253EE", !8, i64 0, !16, i64 4992}
!16 = !{!"long", !8, i64 0}
!17 = !{!"bool", !8, i64 0}
!18 = !{!6, !7, i64 8}
!19 = !{!14, !7, i64 40}
!20 = !{!6, !7, i64 16}
!21 = !{!14, !7, i64 5072}
!22 = !{!6, !7, i64 24}
!23 = !{!14, !7, i64 5080}
!24 = !{!6, !12, i64 40}
!25 = !{!14, !12, i64 5152}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !7, i64 248}
!28 = !{!"_ZTS11ggml_tensor", !29, i64 0, !7, i64 8, !8, i64 16, !8, i64 48, !30, i64 80, !8, i64 84, !12, i64 148, !8, i64 152, !7, i64 232, !16, i64 240, !7, i64 248, !8, i64 256, !7, i64 320, !8, i64 328}
!29 = !{!"_ZTS9ggml_type", !8, i64 0}
!30 = !{!"_ZTS7ggml_op", !8, i64 0}
!31 = !{!6, !11, i64 36}
!32 = !{!14, !7, i64 5120}
!33 = !{!34, !12, i64 4}
!34 = !{!"_ZTS11ggml_cgraph", !12, i64 0, !12, i64 4, !12, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !35, i64 48, !36, i64 72}
!35 = !{!"_ZTS13ggml_hash_set", !16, i64 0, !7, i64 8, !7, i64 16}
!36 = !{!"_ZTS22ggml_cgraph_eval_order", !8, i64 0}
!37 = !{!34, !7, i64 16}
!38 = !{!28, !12, i64 148}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.unroll.disable"}
!41 = !{!16, !16, i64 0}
!42 = !{!17, !17, i64 0}
!43 = !{!14, !7, i64 24}
!44 = !{!14, !7, i64 32}
!45 = !{!6, !10, i64 32}
!46 = distinct !{!46, !47}
!47 = !{!"llvm.loop.mustprogress"}
!48 = !{!14, !7, i64 5096}
!49 = !{!14, !7, i64 5088}
!50 = !{!14, !17, i64 5160}
!51 = !{!14, !7, i64 5104}
!52 = !{!14, !7, i64 5112}
!53 = !{!14, !7, i64 56}
!54 = !{!14, !7, i64 5128}
!55 = !{!14, !7, i64 5136}
!56 = !{!14, !7, i64 5184}
!57 = !{!14, !7, i64 64}
!58 = distinct !{!58, !47}


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