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

; 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_cgraph = type { i32, i32, i32, ptr, ptr, ptr, ptr, %struct.ggml_hash_set, i32 }
%struct.ggml_hash_set = type { i64, ptr, ptr }
%struct.ggml_tensor = type { i32, ptr, [4 x i64], [4 x i64], i32, [16 x i32], i32, [10 x ptr], ptr, i64, ptr, [64 x i8], ptr, [8 x i8] }

@.str.12 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [166 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
declare dso_local 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @ggml_get_unary_op(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_dup_tensor(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_format_name(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local void @ggml_build_backward_expand(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i8, align 1
  %19 = alloca [10 x i8], align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %24 = zext i1 %3 to i8
  store i8 %24, ptr %8, align 1, !tbaa !9
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ggml_cgraph, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %4
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5783, ptr noundef @.str.13, ptr noundef @.str.162) #7
  unreachable

30:                                               ; preds = %4
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ggml_cgraph, ptr %31, i32 0, i32 4
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %30
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5784, ptr noundef @.str.13, ptr noundef @.str.163) #7
  unreachable

36:                                               ; preds = %30
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ggml_cgraph, ptr %37, i32 0, i32 5
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = icmp ne ptr %39, null
  br i1 %40, label %42, label %41

41:                                               ; preds = %36
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5785, ptr noundef @.str.13, ptr noundef @.str.164) #7
  unreachable

42:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.ggml_cgraph, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !11
  store i32 %45, ptr %9, align 4, !tbaa !18
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.ggml_cgraph, ptr %46, i32 0, i32 4
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ggml_cgraph, ptr %49, i32 0, i32 7
  %51 = getelementptr inbounds %struct.ggml_hash_set, ptr %50, i32 0, i32 0
  %52 = load i64, ptr %51, align 8, !tbaa !19
  %53 = mul i64 %52, 8
  call void @llvm.memset.p0.i64(ptr align 8 %48, i8 0, i64 %53, i1 false)
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ggml_cgraph, ptr %54, i32 0, i32 5
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ggml_cgraph, ptr %57, i32 0, i32 7
  %59 = getelementptr inbounds %struct.ggml_hash_set, ptr %58, i32 0, i32 0
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = mul i64 %60, 8
  call void @llvm.memset.p0.i64(ptr align 8 %56, i8 0, i64 %61, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ggml_cgraph, ptr %62, i32 0, i32 7
  %64 = getelementptr inbounds %struct.ggml_hash_set, ptr %63, i32 0, i32 0
  %65 = load i64, ptr %64, align 8, !tbaa !19
  %66 = call noalias ptr @calloc(i64 noundef %65, i64 noundef 1) #9
  store ptr %66, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  store i8 0, ptr %11, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #8
  store i8 0, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !18
  br label %67

67:                                               ; preds = %102, %42
  %68 = load i32, ptr %13, align 4, !tbaa !18
  %69 = load i32, ptr %9, align 4, !tbaa !18
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %105

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.ggml_cgraph, ptr %73, i32 0, i32 3
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  %76 = load i32, ptr %13, align 4, !tbaa !18
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  store ptr %79, ptr %14, align 8, !tbaa !5
  %80 = load i8, ptr %11, align 1, !tbaa !9, !range !21, !noundef !22
  %81 = trunc i8 %80 to i1
  br i1 %81, label %88, label %82

82:                                               ; preds = %72
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ggml_tensor, ptr %83, i32 0, i32 6
  %85 = load i32, ptr %84, align 4, !tbaa !23
  %86 = and i32 %85, 4
  %87 = icmp ne i32 %86, 0
  br label %88

88:                                               ; preds = %82, %72
  %89 = phi i1 [ true, %72 ], [ %87, %82 ]
  %90 = zext i1 %89 to i8
  store i8 %90, ptr %11, align 1, !tbaa !9
  %91 = load i8, ptr %12, align 1, !tbaa !9, !range !21, !noundef !22
  %92 = trunc i8 %91 to i1
  br i1 %92, label %99, label %93

93:                                               ; preds = %88
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ggml_tensor, ptr %94, i32 0, i32 6
  %96 = load i32, ptr %95, align 4, !tbaa !23
  %97 = and i32 %96, 8
  %98 = icmp ne i32 %97, 0
  br label %99

99:                                               ; preds = %93, %88
  %100 = phi i1 [ true, %88 ], [ %98, %93 ]
  %101 = zext i1 %100 to i8
  store i8 %101, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %102

102:                                              ; preds = %99
  %103 = load i32, ptr %13, align 4, !tbaa !18
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %13, align 4, !tbaa !18
  br label %67, !llvm.loop !25

105:                                              ; preds = %71
  %106 = load i8, ptr %11, align 1, !tbaa !9, !range !21, !noundef !22
  %107 = trunc i8 %106 to i1
  br i1 %107, label %108, label %109

108:                                              ; preds = %105
  br i1 true, label %110, label %109

109:                                              ; preds = %108, %105
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5801, ptr noundef @.str.13, ptr noundef @.str.166) #7
  unreachable

110:                                              ; preds = %108
  %111 = load i8, ptr %12, align 1, !tbaa !9, !range !21, !noundef !22
  %112 = trunc i8 %111 to i1
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  br i1 true, label %115, label %114

114:                                              ; preds = %113, %110
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5802, ptr noundef @.str.13, ptr noundef @.str.168) #7
  unreachable

115:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !18
  br label %116

116:                                              ; preds = %332, %115
  %117 = load i32, ptr %15, align 4, !tbaa !18
  %118 = load i32, ptr %9, align 4, !tbaa !18
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %335

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ggml_cgraph, ptr %122, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = load i32, ptr %15, align 4, !tbaa !18
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %124, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  store ptr %128, ptr %17, align 8, !tbaa !5
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ggml_tensor, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %130, align 8, !tbaa !27
  %132 = icmp eq i32 %131, 26
  br i1 %132, label %133, label %134

133:                                              ; preds = %121
  store i32 7, ptr %16, align 4
  br label %329

134:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #8
  %135 = load ptr, ptr %17, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ggml_tensor, ptr %135, i32 0, i32 6
  %137 = load i32, ptr %136, align 4, !tbaa !23
  %138 = and i32 %137, 4
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %146, label %140

140:                                              ; preds = %134
  %141 = load ptr, ptr %17, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.ggml_tensor, ptr %141, i32 0, i32 6
  %143 = load i32, ptr %142, align 4, !tbaa !23
  %144 = and i32 %143, 8
  %145 = icmp ne i32 %144, 0
  br label %146

146:                                              ; preds = %140, %134
  %147 = phi i1 [ true, %134 ], [ %145, %140 ]
  %148 = zext i1 %147 to i8
  store i8 %148, ptr %18, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 10, ptr %19) #8
  call void @llvm.memset.p0.i64(ptr align 1 %19, i8 0, i64 10, i1 false)
  %149 = load ptr, ptr %17, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.ggml_tensor, ptr %149, i32 0, i32 4
  %151 = load i32, ptr %150, align 8, !tbaa !28
  switch i32 %151, label %167 [
    i32 49, label %152
    i32 50, label %152
    i32 74, label %154
    i32 32, label %165
    i32 38, label %165
    i32 39, label %165
    i32 45, label %165
  ]

152:                                              ; preds = %146, %146
  %153 = getelementptr inbounds [10 x i8], ptr %19, i64 0, i64 0
  store i8 1, ptr %153, align 1, !tbaa !9
  br label %168

154:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %155 = load ptr, ptr %17, align 8, !tbaa !5
  %156 = call i32 @ggml_get_unary_op(ptr noundef %155)
  store i32 %156, ptr %20, align 4, !tbaa !18
  %157 = load i32, ptr %20, align 4, !tbaa !18
  %158 = icmp eq i32 %157, 1
  br i1 %158, label %162, label %159

159:                                              ; preds = %154
  %160 = load i32, ptr %20, align 4, !tbaa !18
  %161 = icmp eq i32 %160, 3
  br i1 %161, label %162, label %164

162:                                              ; preds = %159, %154
  %163 = getelementptr inbounds [10 x i8], ptr %19, i64 0, i64 0
  store i8 1, ptr %163, align 1, !tbaa !9
  br label %164

164:                                              ; preds = %162, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %168

165:                                              ; preds = %146, %146, %146, %146
  %166 = getelementptr inbounds [10 x i8], ptr %19, i64 0, i64 1
  store i8 1, ptr %166, align 1, !tbaa !9
  br label %168

167:                                              ; preds = %146
  br label %168

168:                                              ; preds = %167, %165, %164, %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !18
  br label %169

169:                                              ; preds = %224, %168
  %170 = load i32, ptr %21, align 4, !tbaa !18
  %171 = icmp slt i32 %170, 10
  br i1 %171, label %173, label %172

172:                                              ; preds = %169
  store i32 9, ptr %16, align 4
  br label %227

173:                                              ; preds = %169
  %174 = load ptr, ptr %17, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.ggml_tensor, ptr %174, i32 0, i32 7
  %176 = load i32, ptr %21, align 4, !tbaa !18
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [10 x ptr], ptr %175, i64 0, i64 %177
  %179 = load ptr, ptr %178, align 8, !tbaa !5
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %201

181:                                              ; preds = %173
  %182 = load i32, ptr %21, align 4, !tbaa !18
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [10 x i8], ptr %19, i64 0, i64 %183
  %185 = load i8, ptr %184, align 1, !tbaa !9, !range !21, !noundef !22
  %186 = trunc i8 %185 to i1
  br i1 %186, label %201, label %187

187:                                              ; preds = %181
  %188 = load ptr, ptr %10, align 8, !tbaa !5
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ggml_cgraph, ptr %189, i32 0, i32 7
  %191 = load ptr, ptr %17, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.ggml_tensor, ptr %191, i32 0, i32 7
  %193 = load i32, ptr %21, align 4, !tbaa !18
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [10 x ptr], ptr %192, i64 0, i64 %194
  %196 = load ptr, ptr %195, align 8, !tbaa !5
  %197 = call i64 @ggml_hash_find(ptr noundef %190, ptr noundef %196)
  %198 = getelementptr inbounds i8, ptr %188, i64 %197
  %199 = load i8, ptr %198, align 1, !tbaa !9, !range !21, !noundef !22
  %200 = trunc i8 %199 to i1
  br i1 %200, label %202, label %201

201:                                              ; preds = %187, %181, %173
  br label %224

202:                                              ; preds = %187
  %203 = load ptr, ptr %17, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.ggml_tensor, ptr %203, i32 0, i32 7
  %205 = load i32, ptr %21, align 4, !tbaa !18
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [10 x ptr], ptr %204, i64 0, i64 %206
  %208 = load ptr, ptr %207, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.ggml_tensor, ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 8, !tbaa !27
  %211 = icmp eq i32 %210, 0
  br i1 %211, label %223, label %212

212:                                              ; preds = %202
  %213 = load ptr, ptr %17, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.ggml_tensor, ptr %213, i32 0, i32 7
  %215 = load i32, ptr %21, align 4, !tbaa !18
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10 x ptr], ptr %214, i64 0, i64 %216
  %218 = load ptr, ptr %217, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.ggml_tensor, ptr %218, i32 0, i32 0
  %220 = load i32, ptr %219, align 8, !tbaa !27
  %221 = icmp eq i32 %220, 1
  br i1 %221, label %223, label %222

222:                                              ; preds = %212
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5843, ptr noundef @.str.13, ptr noundef @.str.169) #7
  unreachable

223:                                              ; preds = %212, %202
  store i8 1, ptr %18, align 1, !tbaa !9
  store i32 9, ptr %16, align 4
  br label %227

224:                                              ; preds = %201
  %225 = load i32, ptr %21, align 4, !tbaa !18
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %21, align 4, !tbaa !18
  br label %169, !llvm.loop !29

227:                                              ; preds = %223, %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %228

228:                                              ; preds = %227
  %229 = load i8, ptr %18, align 1, !tbaa !9, !range !21, !noundef !22
  %230 = trunc i8 %229 to i1
  br i1 %230, label %232, label %231

231:                                              ; preds = %228
  store i32 7, ptr %16, align 4
  br label %328

232:                                              ; preds = %228
  %233 = load ptr, ptr %17, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.ggml_tensor, ptr %233, i32 0, i32 8
  %235 = load ptr, ptr %234, align 8, !tbaa !30
  %236 = icmp ne ptr %235, null
  br i1 %236, label %237, label %263

237:                                              ; preds = %232
  %238 = load ptr, ptr %17, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.ggml_tensor, ptr %238, i32 0, i32 4
  %240 = load i32, ptr %239, align 8, !tbaa !28
  %241 = icmp eq i32 %240, 32
  br i1 %241, label %263, label %242

242:                                              ; preds = %237
  %243 = load ptr, ptr %17, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.ggml_tensor, ptr %243, i32 0, i32 4
  %245 = load i32, ptr %244, align 8, !tbaa !28
  %246 = icmp eq i32 %245, 35
  br i1 %246, label %263, label %247

247:                                              ; preds = %242
  %248 = load ptr, ptr %17, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.ggml_tensor, ptr %248, i32 0, i32 4
  %250 = load i32, ptr %249, align 8, !tbaa !28
  %251 = icmp eq i32 %250, 34
  br i1 %251, label %263, label %252

252:                                              ; preds = %247
  %253 = load ptr, ptr %17, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.ggml_tensor, ptr %253, i32 0, i32 4
  %255 = load i32, ptr %254, align 8, !tbaa !28
  %256 = icmp eq i32 %255, 36
  br i1 %256, label %263, label %257

257:                                              ; preds = %252
  %258 = load ptr, ptr %17, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.ggml_tensor, ptr %258, i32 0, i32 4
  %260 = load i32, ptr %259, align 8, !tbaa !28
  %261 = icmp eq i32 %260, 37
  br i1 %261, label %263, label %262

262:                                              ; preds = %257
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5853, ptr noundef @.str.13, ptr noundef @.str.170) #7
  unreachable

263:                                              ; preds = %257, %252, %247, %242, %237, %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.ggml_cgraph, ptr %264, i32 0, i32 7
  %266 = load ptr, ptr %17, align 8, !tbaa !5
  %267 = call i64 @ggml_hash_find(ptr noundef %265, ptr noundef %266)
  store i64 %267, ptr %22, align 8, !tbaa !31
  %268 = load i64, ptr %22, align 8, !tbaa !31
  %269 = icmp ne i64 %268, -1
  br i1 %269, label %271, label %270

270:                                              ; preds = %263
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5856, ptr noundef @.str.13, ptr noundef @.str.171) #7
  unreachable

271:                                              ; preds = %263
  %272 = load ptr, ptr %7, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.ggml_cgraph, ptr %272, i32 0, i32 7
  %274 = getelementptr inbounds %struct.ggml_hash_set, ptr %273, i32 0, i32 1
  %275 = load ptr, ptr %274, align 8, !tbaa !32
  %276 = load i64, ptr %22, align 8, !tbaa !31
  %277 = call zeroext i1 @ggml_bitset_get(ptr noundef %275, i64 noundef %276)
  br i1 %277, label %279, label %278

278:                                              ; preds = %271
  call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef @.str.12, i32 noundef 5857, ptr noundef @.str.13, ptr noundef @.str.172) #7
  unreachable

279:                                              ; preds = %271
  %280 = load i8, ptr %8, align 1, !tbaa !9, !range !21, !noundef !22
  %281 = trunc i8 %280 to i1
  br i1 %281, label %282, label %288

282:                                              ; preds = %279
  %283 = load ptr, ptr %17, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.ggml_tensor, ptr %283, i32 0, i32 6
  %285 = load i32, ptr %284, align 4, !tbaa !23
  %286 = and i32 %285, 4
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %294, label %288

288:                                              ; preds = %282, %279
  %289 = load ptr, ptr %17, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.ggml_tensor, ptr %289, i32 0, i32 6
  %291 = load i32, ptr %290, align 4, !tbaa !23
  %292 = and i32 %291, 8
  %293 = icmp ne i32 %292, 0
  br i1 %293, label %294, label %324

294:                                              ; preds = %288, %282
  %295 = load ptr, ptr %5, align 8, !tbaa !5
  %296 = load ptr, ptr %17, align 8, !tbaa !5
  %297 = call ptr @ggml_dup_tensor(ptr noundef %295, ptr noundef %296)
  %298 = load ptr, ptr %7, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.ggml_cgraph, ptr %298, i32 0, i32 5
  %300 = load ptr, ptr %299, align 8, !tbaa !17
  %301 = load i64, ptr %22, align 8, !tbaa !31
  %302 = getelementptr inbounds ptr, ptr %300, i64 %301
  store ptr %297, ptr %302, align 8, !tbaa !5
  %303 = load ptr, ptr %7, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct.ggml_cgraph, ptr %303, i32 0, i32 5
  %305 = load ptr, ptr %304, align 8, !tbaa !17
  %306 = load i64, ptr %22, align 8, !tbaa !31
  %307 = getelementptr inbounds ptr, ptr %305, i64 %306
  %308 = load ptr, ptr %307, align 8, !tbaa !5
  %309 = load ptr, ptr %7, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.ggml_cgraph, ptr %309, i32 0, i32 4
  %311 = load ptr, ptr %310, align 8, !tbaa !16
  %312 = load i64, ptr %22, align 8, !tbaa !31
  %313 = getelementptr inbounds ptr, ptr %311, i64 %312
  store ptr %308, ptr %313, align 8, !tbaa !5
  %314 = load ptr, ptr %7, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.ggml_cgraph, ptr %314, i32 0, i32 5
  %316 = load ptr, ptr %315, align 8, !tbaa !17
  %317 = load i64, ptr %22, align 8, !tbaa !31
  %318 = getelementptr inbounds ptr, ptr %316, i64 %317
  %319 = load ptr, ptr %318, align 8, !tbaa !5
  %320 = load ptr, ptr %17, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.ggml_tensor, ptr %320, i32 0, i32 11
  %322 = getelementptr inbounds [64 x i8], ptr %321, i64 0, i64 0
  %323 = call ptr (ptr, ptr, ...) @ggml_format_name(ptr noundef %319, ptr noundef @.str.173, ptr noundef %322)
  br label %324

324:                                              ; preds = %294, %288
  %325 = load ptr, ptr %10, align 8, !tbaa !5
  %326 = load i64, ptr %22, align 8, !tbaa !31
  %327 = getelementptr inbounds i8, ptr %325, i64 %326
  store i8 1, ptr %327, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  store i32 0, ptr %16, align 4
  br label %328

328:                                              ; preds = %324, %231
  call void @llvm.lifetime.end.p0(i64 10, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #8
  br label %329

329:                                              ; preds = %328, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %330 = load i32, ptr %16, align 4
  switch i32 %330, label %352 [
    i32 0, label %331
    i32 7, label %332
  ]

331:                                              ; preds = %329
  br label %332

332:                                              ; preds = %331, %329
  %333 = load i32, ptr %15, align 4, !tbaa !18
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %15, align 4, !tbaa !18
  br label %116, !llvm.loop !33

335:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %336 = load i32, ptr %9, align 4, !tbaa !18
  %337 = sub nsw i32 %336, 1
  store i32 %337, ptr %23, align 4, !tbaa !18
  br label %338

338:                                              ; preds = %347, %335
  %339 = load i32, ptr %23, align 4, !tbaa !18
  %340 = icmp sge i32 %339, 0
  br i1 %340, label %342, label %341

341:                                              ; preds = %338
  store i32 12, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %350

342:                                              ; preds = %338
  %343 = load ptr, ptr %6, align 8, !tbaa !5
  %344 = load ptr, ptr %7, align 8, !tbaa !5
  %345 = load i32, ptr %23, align 4, !tbaa !18
  %346 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ggml_compute_backward(ptr noundef %343, ptr noundef %344, i32 noundef %345, ptr noundef %346)
  br label %347

347:                                              ; preds = %342
  %348 = load i32, ptr %23, align 4, !tbaa !18
  %349 = add nsw i32 %348, -1
  store i32 %349, ptr %23, align 4, !tbaa !18
  br label %338, !llvm.loop !34

350:                                              ; preds = %341
  %351 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %351) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  ret void

352:                                              ; preds = %329
  unreachable
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i64 @ggml_hash_find(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @ggml_bitset_get(ptr noundef, i64 noundef) #6

; Function Attrs: nounwind uwtable
declare hidden void @ggml_compute_backward(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

!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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"ggml_cgraph", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !14, i64 48, !13, i64 72}
!13 = !{!"int", !7, i64 0}
!14 = !{!"ggml_hash_set", !15, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!12, !6, i64 24}
!17 = !{!12, !6, i64 32}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !15, i64 48}
!20 = !{!12, !6, i64 16}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!24, !13, i64 148}
!24 = !{!"ggml_tensor", !13, i64 0, !6, i64 8, !7, i64 16, !7, i64 48, !13, i64 80, !7, i64 84, !13, i64 148, !7, i64 152, !6, i64 232, !15, i64 240, !6, i64 248, !7, i64 256, !6, i64 320, !7, i64 328}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!24, !13, i64 0}
!28 = !{!24, !13, i64 80}
!29 = distinct !{!29, !26}
!30 = !{!24, !6, i64 232}
!31 = !{!15, !15, i64 0}
!32 = !{!12, !6, i64 56}
!33 = distinct !{!33, !26}
!34 = distinct !{!34, !26}


; 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.12 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.162 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.163 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.164 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.166 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [76 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [166 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.173 = external hidden unnamed_addr constant [16 x i8], align 1

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @ggml_get_unary_op(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_dup_tensor(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @ggml_format_name(ptr noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local void @ggml_build_backward_expand(ptr noundef %0, ptr noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %2, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %9, label %8

8:                                                ; preds = %4
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5783, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.162) #7
  unreachable

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %2, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %12, label %13

12:                                               ; preds = %9
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5784, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.163) #7
  unreachable

13:                                               ; preds = %9
  %14 = getelementptr inbounds i8, ptr %2, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %.not93 = icmp eq ptr %15, null
  br i1 %.not93, label %16, label %.lr.ph

16:                                               ; preds = %13
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5785, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.164) #7
  unreachable

.lr.ph:                                           ; preds = %13
  %17 = getelementptr inbounds i8, ptr %2, i64 48
  %18 = load i64, ptr %17, align 8, !tbaa !15
  %19 = shl i64 %18, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %11, i8 0, i64 %19, i1 false)
  %20 = load ptr, ptr %14, align 8, !tbaa !14
  %21 = load i64, ptr %17, align 8, !tbaa !15
  %22 = shl i64 %21, 3
  tail call void @llvm.memset.p0.i64(ptr align 8 %20, i8 0, i64 %22, i1 false)
  %23 = load i64, ptr %17, align 8, !tbaa !15
  %24 = tail call noalias ptr @calloc(i64 noundef %23, i64 noundef 1) #8
  %25 = getelementptr inbounds i8, ptr %2, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %wide.trip.count = zext nneg i32 %6 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %27 = icmp eq i32 %6, 1
  br i1 %27, label %._crit_edge.unr-lcssa, label %.lr.ph.new

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

._crit_edge.unr-lcssa:                            ; preds = %73, %.lr.ph
  %.lcssa143.ph = phi i1 [ poison, %.lr.ph ], [ %74, %73 ]
  %.lcssa142.ph = phi i1 [ poison, %.lr.ph ], [ %67, %73 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.1, %73 ]
  %.081104.unr = phi i1 [ false, %.lr.ph ], [ %67, %73 ]
  %.083103.unr = phi i1 [ false, %.lr.ph ], [ %74, %73 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.unr-lcssa
  %28 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv.unr
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  br i1 %.081104.unr, label %35, label %30

30:                                               ; preds = %.epil.preheader
  %31 = getelementptr inbounds i8, ptr %29, i64 148
  %32 = load i32, ptr %31, align 4, !tbaa !18
  %33 = and i32 %32, 4
  %34 = icmp ne i32 %33, 0
  br label %35

35:                                               ; preds = %30, %.epil.preheader
  %36 = phi i1 [ true, %.epil.preheader ], [ %34, %30 ]
  br i1 %.083103.unr, label %._crit_edge, label %37

37:                                               ; preds = %35
  %38 = getelementptr inbounds i8, ptr %29, i64 148
  %39 = load i32, ptr %38, align 4, !tbaa !18
  %40 = and i32 %39, 8
  %41 = icmp ne i32 %40, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %35, %37, %._crit_edge.unr-lcssa
  %.lcssa143 = phi i1 [ %.lcssa143.ph, %._crit_edge.unr-lcssa ], [ true, %35 ], [ %41, %37 ]
  %.lcssa142 = phi i1 [ %.lcssa142.ph, %._crit_edge.unr-lcssa ], [ %36, %37 ], [ %36, %35 ]
  br i1 %.lcssa142, label %76, label %75

42:                                               ; preds = %73, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.1, %73 ]
  %.081104 = phi i1 [ false, %.lr.ph.new ], [ %67, %73 ]
  %.083103 = phi i1 [ false, %.lr.ph.new ], [ %74, %73 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %73 ]
  %43 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  br i1 %.081104, label %50, label %45

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %44, i64 148
  %47 = load i32, ptr %46, align 4, !tbaa !18
  %48 = and i32 %47, 4
  %49 = icmp ne i32 %48, 0
  br label %50

50:                                               ; preds = %45, %42
  %51 = phi i1 [ true, %42 ], [ %49, %45 ]
  br i1 %.083103, label %57, label %52

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %44, i64 148
  %54 = load i32, ptr %53, align 4, !tbaa !18
  %55 = and i32 %54, 8
  %56 = icmp ne i32 %55, 0
  br label %57

57:                                               ; preds = %52, %50
  %58 = phi i1 [ true, %50 ], [ %56, %52 ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %59 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv.next
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  br i1 %51, label %66, label %61

61:                                               ; preds = %57
  %62 = getelementptr inbounds i8, ptr %60, i64 148
  %63 = load i32, ptr %62, align 4, !tbaa !18
  %64 = and i32 %63, 4
  %65 = icmp ne i32 %64, 0
  br label %66

66:                                               ; preds = %61, %57
  %67 = phi i1 [ true, %57 ], [ %65, %61 ]
  br i1 %58, label %73, label %68

68:                                               ; preds = %66
  %69 = getelementptr inbounds i8, ptr %60, i64 148
  %70 = load i32, ptr %69, align 4, !tbaa !18
  %71 = and i32 %70, 8
  %72 = icmp ne i32 %71, 0
  br label %73

73:                                               ; preds = %68, %66
  %74 = phi i1 [ true, %66 ], [ %72, %68 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.unr-lcssa, label %42, !llvm.loop !20

75:                                               ; preds = %._crit_edge
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5801, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.166) #7
  unreachable

76:                                               ; preds = %._crit_edge
  br i1 %.lcssa143, label %.lr.ph110, label %79

.lr.ph110:                                        ; preds = %76
  %77 = getelementptr inbounds i8, ptr %2, i64 16
  %78 = getelementptr inbounds i8, ptr %2, i64 56
  %smax = tail call i32 @llvm.smax.i32(i32 %6, i32 1)
  %wide.trip.count124 = zext nneg i32 %smax to i64
  %.not137 = xor i1 %3, true
  br label %80

79:                                               ; preds = %76
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5802, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.168) #7
  unreachable

80:                                               ; preds = %.lr.ph110, %214
  %indvars.iv121 = phi i64 [ 0, %.lr.ph110 ], [ %indvars.iv.next122, %214 ]
  %81 = load ptr, ptr %77, align 8, !tbaa !16
  %82 = getelementptr inbounds ptr, ptr %81, i64 %indvars.iv121
  %83 = load ptr, ptr %82, align 8, !tbaa !17
  %84 = load i32, ptr %83, align 8, !tbaa !22
  %85 = icmp eq i32 %84, 26
  br i1 %85, label %214, label %86

86:                                               ; preds = %80
  %87 = getelementptr inbounds i8, ptr %83, i64 148
  %88 = load i32, ptr %87, align 4, !tbaa !18
  %89 = and i32 %88, 12
  %.not100 = icmp eq i32 %89, 0
  %90 = getelementptr inbounds i8, ptr %83, i64 80
  %91 = load i32, ptr %90, align 8, !tbaa !23
  switch i32 %91, label %97 [
    i32 49, label %92
    i32 50, label %92
    i32 74, label %93
    i32 32, label %96
    i32 38, label %96
    i32 39, label %96
    i32 45, label %96
  ]

92:                                               ; preds = %86, %86
  br label %97

93:                                               ; preds = %86
  %94 = tail call i32 @ggml_get_unary_op(ptr noundef nonnull %83)
  %95 = and i32 %94, -3
  %or.cond = icmp eq i32 %95, 1
  br label %97

96:                                               ; preds = %86, %86, %86, %86
  br label %97

97:                                               ; preds = %93, %86, %96, %92
  %.sroa.6.1 = phi i1 [ false, %86 ], [ true, %96 ], [ false, %92 ], [ false, %93 ]
  %.sroa.0.1 = phi i1 [ false, %86 ], [ false, %96 ], [ true, %92 ], [ %or.cond, %93 ]
  %98 = getelementptr inbounds i8, ptr %83, i64 152
  %99 = load ptr, ptr %98, align 8, !tbaa !17
  %.not95 = icmp eq ptr %99, null
  %brmerge = or i1 %.not95, %.sroa.0.1
  br i1 %brmerge, label %110, label %100

100:                                              ; preds = %97
  %101 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %99)
  %102 = getelementptr inbounds i8, ptr %24, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !24, !range !26, !noundef !27
  %104 = trunc nuw i8 %103 to i1
  br i1 %104, label %105, label %110

105:                                              ; preds = %177, %169, %161, %153, %145, %137, %129, %121, %113, %100
  %.lcssa = phi i64 [ 0, %100 ], [ 1, %113 ], [ 2, %121 ], [ 3, %129 ], [ 4, %137 ], [ 5, %145 ], [ 6, %153 ], [ 7, %161 ], [ 8, %169 ], [ 9, %177 ]
  %106 = getelementptr inbounds [10 x ptr], ptr %98, i64 0, i64 %.lcssa
  %107 = load ptr, ptr %106, align 8, !tbaa !17
  %108 = load i32, ptr %107, align 8, !tbaa !22
  %switch = icmp ult i32 %108, 2
  br i1 %switch, label %.critedge, label %109

109:                                              ; preds = %105
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5843, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.169) #7
  unreachable

110:                                              ; preds = %97, %100
  %111 = getelementptr inbounds i8, ptr %83, i64 160
  %112 = load ptr, ptr %111, align 8, !tbaa !17
  %.not95.1 = icmp eq ptr %112, null
  %brmerge136 = or i1 %.not95.1, %.sroa.6.1
  br i1 %brmerge136, label %118, label %113

113:                                              ; preds = %110
  %114 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %112)
  %115 = getelementptr inbounds i8, ptr %24, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !24, !range !26, !noundef !27
  %117 = trunc nuw i8 %116 to i1
  br i1 %117, label %105, label %118

118:                                              ; preds = %110, %113
  %119 = getelementptr inbounds i8, ptr %83, i64 168
  %120 = load ptr, ptr %119, align 8, !tbaa !17
  %.not95.2 = icmp eq ptr %120, null
  br i1 %.not95.2, label %126, label %121

121:                                              ; preds = %118
  %122 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %120)
  %123 = getelementptr inbounds i8, ptr %24, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !24, !range !26, !noundef !27
  %125 = trunc nuw i8 %124 to i1
  br i1 %125, label %105, label %126

126:                                              ; preds = %121, %118
  %127 = getelementptr inbounds i8, ptr %83, i64 176
  %128 = load ptr, ptr %127, align 8, !tbaa !17
  %.not95.3 = icmp eq ptr %128, null
  br i1 %.not95.3, label %134, label %129

129:                                              ; preds = %126
  %130 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %128)
  %131 = getelementptr inbounds i8, ptr %24, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !24, !range !26, !noundef !27
  %133 = trunc nuw i8 %132 to i1
  br i1 %133, label %105, label %134

134:                                              ; preds = %129, %126
  %135 = getelementptr inbounds i8, ptr %83, i64 184
  %136 = load ptr, ptr %135, align 8, !tbaa !17
  %.not95.4 = icmp eq ptr %136, null
  br i1 %.not95.4, label %142, label %137

137:                                              ; preds = %134
  %138 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %136)
  %139 = getelementptr inbounds i8, ptr %24, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !24, !range !26, !noundef !27
  %141 = trunc nuw i8 %140 to i1
  br i1 %141, label %105, label %142

142:                                              ; preds = %137, %134
  %143 = getelementptr inbounds i8, ptr %83, i64 192
  %144 = load ptr, ptr %143, align 8, !tbaa !17
  %.not95.5 = icmp eq ptr %144, null
  br i1 %.not95.5, label %150, label %145

145:                                              ; preds = %142
  %146 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %144)
  %147 = getelementptr inbounds i8, ptr %24, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !24, !range !26, !noundef !27
  %149 = trunc nuw i8 %148 to i1
  br i1 %149, label %105, label %150

150:                                              ; preds = %145, %142
  %151 = getelementptr inbounds i8, ptr %83, i64 200
  %152 = load ptr, ptr %151, align 8, !tbaa !17
  %.not95.6 = icmp eq ptr %152, null
  br i1 %.not95.6, label %158, label %153

153:                                              ; preds = %150
  %154 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %152)
  %155 = getelementptr inbounds i8, ptr %24, i64 %154
  %156 = load i8, ptr %155, align 1, !tbaa !24, !range !26, !noundef !27
  %157 = trunc nuw i8 %156 to i1
  br i1 %157, label %105, label %158

158:                                              ; preds = %153, %150
  %159 = getelementptr inbounds i8, ptr %83, i64 208
  %160 = load ptr, ptr %159, align 8, !tbaa !17
  %.not95.7 = icmp eq ptr %160, null
  br i1 %.not95.7, label %166, label %161

161:                                              ; preds = %158
  %162 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %160)
  %163 = getelementptr inbounds i8, ptr %24, i64 %162
  %164 = load i8, ptr %163, align 1, !tbaa !24, !range !26, !noundef !27
  %165 = trunc nuw i8 %164 to i1
  br i1 %165, label %105, label %166

166:                                              ; preds = %161, %158
  %167 = getelementptr inbounds i8, ptr %83, i64 216
  %168 = load ptr, ptr %167, align 8, !tbaa !17
  %.not95.8 = icmp eq ptr %168, null
  br i1 %.not95.8, label %174, label %169

169:                                              ; preds = %166
  %170 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %168)
  %171 = getelementptr inbounds i8, ptr %24, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !24, !range !26, !noundef !27
  %173 = trunc nuw i8 %172 to i1
  br i1 %173, label %105, label %174

174:                                              ; preds = %169, %166
  %175 = getelementptr inbounds i8, ptr %83, i64 224
  %176 = load ptr, ptr %175, align 8, !tbaa !17
  %.not95.9 = icmp eq ptr %176, null
  br i1 %.not95.9, label %182, label %177

177:                                              ; preds = %174
  %178 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %176)
  %179 = getelementptr inbounds i8, ptr %24, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !24, !range !26, !noundef !27
  %181 = trunc nuw i8 %180 to i1
  br i1 %181, label %105, label %182

182:                                              ; preds = %177, %174
  br i1 %.not100, label %214, label %.critedge

.critedge:                                        ; preds = %105, %182
  %183 = getelementptr inbounds i8, ptr %83, i64 232
  %184 = load ptr, ptr %183, align 8, !tbaa !28
  %.not96 = icmp eq ptr %184, null
  br i1 %.not96, label %188, label %185

185:                                              ; preds = %.critedge
  %186 = load i32, ptr %90, align 8, !tbaa !23
  switch i32 %186, label %187 [
    i32 32, label %188
    i32 35, label %188
    i32 34, label %188
    i32 36, label %188
    i32 37, label %188
  ]

187:                                              ; preds = %185
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5853, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.170) #7
  unreachable

188:                                              ; preds = %185, %185, %185, %185, %185, %.critedge
  %189 = tail call i64 @ggml_hash_find(ptr noundef nonnull %17, ptr noundef nonnull %83)
  %.not97 = icmp eq i64 %189, -1
  br i1 %.not97, label %190, label %191

190:                                              ; preds = %188
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5856, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.171) #7
  unreachable

191:                                              ; preds = %188
  %192 = load ptr, ptr %78, align 8, !tbaa !29
  %193 = tail call zeroext i1 @ggml_bitset_get(ptr noundef %192, i64 noundef %189)
  br i1 %193, label %195, label %194

194:                                              ; preds = %191
  tail call void (ptr, i32, ptr, ...) @ggml_abort(ptr noundef nonnull @.str.12, i32 noundef 5857, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.172) #7
  unreachable

195:                                              ; preds = %191
  %.pre = load i32, ptr %87, align 4, !tbaa !18
  %196 = and i32 %.pre, 4
  %.not98 = icmp eq i32 %196, 0
  %or.cond138 = select i1 %.not137, i1 true, i1 %.not98
  %197 = and i32 %.pre, 8
  %.not99 = icmp eq i32 %197, 0
  %or.cond139 = select i1 %or.cond138, i1 %.not99, i1 false
  br i1 %or.cond139, label %212, label %198

198:                                              ; preds = %195
  %199 = tail call ptr @ggml_dup_tensor(ptr noundef %0, ptr noundef nonnull %83)
  %200 = load ptr, ptr %14, align 8, !tbaa !14
  %201 = getelementptr inbounds ptr, ptr %200, i64 %189
  store ptr %199, ptr %201, align 8, !tbaa !17
  %202 = load ptr, ptr %14, align 8, !tbaa !14
  %203 = getelementptr inbounds ptr, ptr %202, i64 %189
  %204 = load ptr, ptr %203, align 8, !tbaa !17
  %205 = load ptr, ptr %10, align 8, !tbaa !13
  %206 = getelementptr inbounds ptr, ptr %205, i64 %189
  store ptr %204, ptr %206, align 8, !tbaa !17
  %207 = load ptr, ptr %14, align 8, !tbaa !14
  %208 = getelementptr inbounds ptr, ptr %207, i64 %189
  %209 = load ptr, ptr %208, align 8, !tbaa !17
  %210 = getelementptr inbounds i8, ptr %83, i64 256
  %211 = tail call ptr (ptr, ptr, ...) @ggml_format_name(ptr noundef %209, ptr noundef nonnull @.str.173, ptr noundef nonnull %210)
  br label %212

212:                                              ; preds = %195, %198
  %213 = getelementptr inbounds i8, ptr %24, i64 %189
  store i8 1, ptr %213, align 1, !tbaa !24
  br label %214

214:                                              ; preds = %212, %182, %80
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
  br i1 %exitcond125.not, label %.lr.ph112, label %80, !llvm.loop !30

._crit_edge113:                                   ; preds = %.lr.ph112
  tail call void @free(ptr noundef %24) #9
  ret void

.lr.ph112:                                        ; preds = %214, %.lr.ph112
  %.0.in111 = phi i32 [ %.0, %.lr.ph112 ], [ %6, %214 ]
  %.0 = add nsw i32 %.0.in111, -1
  tail call void @ggml_compute_backward(ptr noundef %1, ptr noundef %2, i32 noundef %.0, ptr noundef %24)
  %215 = icmp sgt i32 %.0.in111, 1
  br i1 %215, label %.lr.ph112, label %._crit_edge113, !llvm.loop !31
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i64 @ggml_hash_find(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @ggml_bitset_get(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden void @ggml_compute_backward(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { noreturn 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 #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { 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 4}
!6 = !{!"ggml_cgraph", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !7, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"ggml_hash_set", !12, i64 0, !10, i64 8, !10, i64 16}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !10, i64 24}
!14 = !{!6, !10, i64 32}
!15 = !{!6, !12, i64 48}
!16 = !{!6, !10, i64 16}
!17 = !{!10, !10, i64 0}
!18 = !{!19, !7, i64 148}
!19 = !{!"ggml_tensor", !7, i64 0, !10, i64 8, !8, i64 16, !8, i64 48, !7, i64 80, !8, i64 84, !7, i64 148, !8, i64 152, !10, i64 232, !12, i64 240, !10, i64 248, !8, i64 256, !10, i64 320, !8, i64 328}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!19, !7, i64 0}
!23 = !{!19, !7, i64 80}
!24 = !{!25, !25, i64 0}
!25 = !{!"_Bool", !8, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!19, !10, i64 232}
!29 = !{!6, !10, i64 56}
!30 = distinct !{!30, !21}
!31 = distinct !{!31, !21}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass