; LLVM IR from harharkh/sb_desc :: src (matrix)

; 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.sb_mat = type { i64, i64, i64, ptr }
%struct.sb_vec = type { i64, ptr, i8 }

@sb_error_log = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() #2

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

declare void @cblas_dscal(i32 noundef, double noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @sb_mat_vmul(ptr noalias noundef %0, ptr noalias noundef %1, i8 noundef signext %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i8 %2, ptr %6, align 1, !tbaa !9
  br label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %35, label %16

16:                                               ; preds = %13
  %17 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %21

19:                                               ; preds = %16
  %20 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %23

21:                                               ; preds = %16
  %22 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %21, %19
  %24 = phi ptr [ %20, %19 ], [ %22, %21 ]
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.102) #5
  %26 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %30

28:                                               ; preds = %23
  %29 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %32

30:                                               ; preds = %23
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %30, %28
  %33 = phi ptr [ %29, %28 ], [ %31, %30 ]
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

35:                                               ; preds = %13
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %59, label %40

40:                                               ; preds = %37
  %41 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  %44 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %47

45:                                               ; preds = %40
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %45, %43
  %48 = phi ptr [ %44, %43 ], [ %46, %45 ]
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.103) #5
  %50 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %51 = icmp ne ptr %50, null
  br i1 %51, label %52, label %54

52:                                               ; preds = %47
  %53 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %56

54:                                               ; preds = %47
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %54, %52
  %57 = phi ptr [ %53, %52 ], [ %55, %54 ]
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

59:                                               ; preds = %37
  br label %60

60:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.sb_mat, ptr %61, i32 0, i32 0
  %63 = load i64, ptr %62, align 8, !tbaa !10
  store i64 %63, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.sb_mat, ptr %64, i32 0, i32 1
  %66 = load i64, ptr %65, align 8, !tbaa !14
  store i64 %66, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.sb_mat, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  store ptr %69, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.sb_vec, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  store ptr %72, ptr %10, align 8, !tbaa !5
  %73 = load i8, ptr %6, align 1, !tbaa !9
  %74 = sext i8 %73 to i32
  switch i32 %74, label %235 [
    i32 99, label %75
    i32 114, label %155
  ]

75:                                               ; preds = %60
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.sb_vec, ptr %77, i32 0, i32 2
  %79 = load i8, ptr %78, align 8, !tbaa !18
  %80 = sext i8 %79 to i32
  %81 = icmp ne i32 %80, 114
  br i1 %81, label %82, label %101

82:                                               ; preds = %76
  %83 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %85, label %87

85:                                               ; preds = %82
  %86 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %89

87:                                               ; preds = %82
  %88 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %89

89:                                               ; preds = %87, %85
  %90 = phi ptr [ %86, %85 ], [ %88, %87 ]
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.104) #5
  %92 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %96

94:                                               ; preds = %89
  %95 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %98

96:                                               ; preds = %89
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %96, %94
  %99 = phi ptr [ %95, %94 ], [ %97, %96 ]
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

101:                                              ; preds = %76
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.sb_mat, ptr %105, i32 0, i32 1
  %107 = load i64, ptr %106, align 8, !tbaa !14
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.sb_vec, ptr %108, i32 0, i32 0
  %110 = load i64, ptr %109, align 8, !tbaa !19
  %111 = icmp ne i64 %107, %110
  br i1 %111, label %112, label %131

112:                                              ; preds = %104
  %113 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %117

115:                                              ; preds = %112
  %116 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %119

117:                                              ; preds = %112
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %117, %115
  %120 = phi ptr [ %116, %115 ], [ %118, %117 ]
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.105) #5
  %122 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %123 = icmp ne ptr %122, null
  br i1 %123, label %124, label %126

124:                                              ; preds = %119
  %125 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %128

126:                                              ; preds = %119
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %128

128:                                              ; preds = %126, %124
  %129 = phi ptr [ %125, %124 ], [ %127, %126 ]
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

131:                                              ; preds = %104
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %134

134:                                              ; preds = %151, %133
  %135 = load i64, ptr %11, align 8, !tbaa !13
  %136 = load i64, ptr %8, align 8, !tbaa !13
  %137 = icmp ult i64 %135, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %154

139:                                              ; preds = %134
  %140 = load i64, ptr %7, align 8, !tbaa !13
  %141 = trunc i64 %140 to i32
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = load i64, ptr %11, align 8, !tbaa !13
  %144 = getelementptr inbounds double, ptr %142, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !20
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load i64, ptr %11, align 8, !tbaa !13
  %148 = load i64, ptr %7, align 8, !tbaa !13
  %149 = mul i64 %147, %148
  %150 = getelementptr inbounds double, ptr %146, i64 %149
  call void @cblas_dscal(i32 noundef %141, double noundef %145, ptr noundef %150, i32 noundef 1)
  br label %151

151:                                              ; preds = %139
  %152 = load i64, ptr %11, align 8, !tbaa !13
  %153 = add i64 %152, 1
  store i64 %153, ptr %11, align 8, !tbaa !13
  br label %134, !llvm.loop !22

154:                                              ; preds = %138
  br label %257

155:                                              ; preds = %60
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.sb_vec, ptr %157, i32 0, i32 2
  %159 = load i8, ptr %158, align 8, !tbaa !18
  %160 = sext i8 %159 to i32
  %161 = icmp ne i32 %160, 99
  br i1 %161, label %162, label %181

162:                                              ; preds = %156
  %163 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %164 = icmp ne ptr %163, null
  br i1 %164, label %165, label %167

165:                                              ; preds = %162
  %166 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %169

167:                                              ; preds = %162
  %168 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %169

169:                                              ; preds = %167, %165
  %170 = phi ptr [ %166, %165 ], [ %168, %167 ]
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.106) #5
  %172 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %176

174:                                              ; preds = %169
  %175 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %178

176:                                              ; preds = %169
  %177 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %178

178:                                              ; preds = %176, %174
  %179 = phi ptr [ %175, %174 ], [ %177, %176 ]
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

181:                                              ; preds = %156
  br label %182

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.sb_mat, ptr %185, i32 0, i32 0
  %187 = load i64, ptr %186, align 8, !tbaa !10
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.sb_vec, ptr %188, i32 0, i32 0
  %190 = load i64, ptr %189, align 8, !tbaa !19
  %191 = icmp ne i64 %187, %190
  br i1 %191, label %192, label %211

192:                                              ; preds = %184
  %193 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %194 = icmp ne ptr %193, null
  br i1 %194, label %195, label %197

195:                                              ; preds = %192
  %196 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %199

197:                                              ; preds = %192
  %198 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %199

199:                                              ; preds = %197, %195
  %200 = phi ptr [ %196, %195 ], [ %198, %197 ]
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str.107) #5
  %202 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %203 = icmp ne ptr %202, null
  br i1 %203, label %204, label %206

204:                                              ; preds = %199
  %205 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %208

206:                                              ; preds = %199
  %207 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %208

208:                                              ; preds = %206, %204
  %209 = phi ptr [ %205, %204 ], [ %207, %206 ]
  %210 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %209, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

211:                                              ; preds = %184
  br label %212

212:                                              ; preds = %211
  br label %213

213:                                              ; preds = %212
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 0, ptr %12, align 8, !tbaa !13
  br label %214

214:                                              ; preds = %231, %213
  %215 = load i64, ptr %12, align 8, !tbaa !13
  %216 = load i64, ptr %7, align 8, !tbaa !13
  %217 = icmp ult i64 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %234

219:                                              ; preds = %214
  %220 = load i64, ptr %8, align 8, !tbaa !13
  %221 = trunc i64 %220 to i32
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  %223 = load i64, ptr %12, align 8, !tbaa !13
  %224 = getelementptr inbounds double, ptr %222, i64 %223
  %225 = load double, ptr %224, align 8, !tbaa !20
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = load i64, ptr %12, align 8, !tbaa !13
  %228 = getelementptr inbounds double, ptr %226, i64 %227
  %229 = load i64, ptr %7, align 8, !tbaa !13
  %230 = trunc i64 %229 to i32
  call void @cblas_dscal(i32 noundef %221, double noundef %225, ptr noundef %228, i32 noundef %230)
  br label %231

231:                                              ; preds = %219
  %232 = load i64, ptr %12, align 8, !tbaa !13
  %233 = add i64 %232, 1
  store i64 %233, ptr %12, align 8, !tbaa !13
  br label %214, !llvm.loop !24

234:                                              ; preds = %218
  br label %257

235:                                              ; preds = %60
  br label %236

236:                                              ; preds = %235
  %237 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %238 = icmp ne ptr %237, null
  br i1 %238, label %239, label %241

239:                                              ; preds = %236
  %240 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %243

241:                                              ; preds = %236
  %242 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %243

243:                                              ; preds = %241, %239
  %244 = phi ptr [ %240, %239 ], [ %242, %241 ]
  %245 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %244, ptr noundef @.str.108) #5
  %246 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %247 = icmp ne ptr %246, null
  br i1 %247, label %248, label %250

248:                                              ; preds = %243
  %249 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %252

250:                                              ; preds = %243
  %251 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %252

252:                                              ; preds = %250, %248
  %253 = phi ptr [ %249, %248 ], [ %251, %250 ]
  %254 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %253, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

255:                                              ; No predecessors!
  br label %256

256:                                              ; preds = %255
  br label %257

257:                                              ; preds = %256, %234, %154
  br label %258

258:                                              ; preds = %257
  %259 = load ptr, ptr %4, align 8, !tbaa !5
  %260 = call i32 @sb_mat_is_finite(ptr noundef %259)
  %261 = icmp ne i32 %260, 0
  br i1 %261, label %281, label %262

262:                                              ; preds = %258
  %263 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %264 = icmp ne ptr %263, null
  br i1 %264, label %265, label %267

265:                                              ; preds = %262
  %266 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %269

267:                                              ; preds = %262
  %268 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %269

269:                                              ; preds = %267, %265
  %270 = phi ptr [ %266, %265 ], [ %268, %267 ]
  %271 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %270, ptr noundef @.str.109) #5
  %272 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %273 = icmp ne ptr %272, null
  br i1 %273, label %274, label %276

274:                                              ; preds = %269
  %275 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %278

276:                                              ; preds = %269
  %277 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %278

278:                                              ; preds = %276, %274
  %279 = phi ptr [ %275, %274 ], [ %277, %276 ]
  %280 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %279, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

281:                                              ; preds = %258
  br label %282

282:                                              ; preds = %281
  br label %283

283:                                              ; preds = %282
  %284 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret ptr %284
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 0}
!11 = !{!"", !12, i64 0, !12, i64 8, !12, i64 16, !6, i64 24}
!12 = !{!"long", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!11, !12, i64 8}
!15 = !{!11, !6, i64 24}
!16 = !{!17, !6, i64 8}
!17 = !{!"", !12, i64 0, !6, i64 8, !7, i64 16}
!18 = !{!17, !7, i64 16}
!19 = !{!17, !12, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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

@sb_error_log = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.104 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.105 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.106 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.107 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.108 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.109 = external hidden unnamed_addr constant [33 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #1

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

declare void @cblas_dscal(i32 noundef, double noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @sb_mat_vmul(ptr noalias noundef returned %0, ptr noalias noundef readonly %1, i8 noundef signext %2) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %13

4:                                                ; preds = %3
  %5 = load ptr, ptr @sb_error_log, align 8
  %.not37 = icmp eq ptr %5, null
  %6 = load ptr, ptr @stderr, align 8
  %7 = select i1 %.not37, ptr %6, ptr %5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.102) #4
  %9 = load ptr, ptr @sb_error_log, align 8
  %.not38 = icmp eq ptr %9, null
  %10 = load ptr, ptr @stderr, align 8
  %11 = select i1 %.not38, ptr %10, ptr %9
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

13:                                               ; preds = %3
  %.not39 = icmp eq ptr %1, null
  br i1 %.not39, label %14, label %23

14:                                               ; preds = %13
  %15 = load ptr, ptr @sb_error_log, align 8
  %.not40 = icmp eq ptr %15, null
  %16 = load ptr, ptr @stderr, align 8
  %17 = select i1 %.not40, ptr %16, ptr %15
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.103) #4
  %19 = load ptr, ptr @sb_error_log, align 8
  %.not41 = icmp eq ptr %19, null
  %20 = load ptr, ptr @stderr, align 8
  %21 = select i1 %.not41, ptr %20, ptr %19
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

23:                                               ; preds = %13
  %24 = load i64, ptr %0, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %1, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  switch i8 %2, label %91 [
    i8 99, label %31
    i8 114, label %61
  ]

31:                                               ; preds = %23
  %32 = getelementptr inbounds i8, ptr %1, i64 16
  %33 = load i8, ptr %32, align 8, !tbaa !15
  %.not48 = icmp eq i8 %33, 114
  br i1 %.not48, label %43, label %34

34:                                               ; preds = %31
  %35 = load ptr, ptr @sb_error_log, align 8
  %.not55 = icmp eq ptr %35, null
  %36 = load ptr, ptr @stderr, align 8
  %37 = select i1 %.not55, ptr %36, ptr %35
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.104) #4
  %39 = load ptr, ptr @sb_error_log, align 8
  %.not56 = icmp eq ptr %39, null
  %40 = load ptr, ptr @stderr, align 8
  %41 = select i1 %.not56, ptr %40, ptr %39
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

43:                                               ; preds = %31
  %44 = load i64, ptr %1, align 8, !tbaa !16
  %.not49 = icmp eq i64 %26, %44
  br i1 %.not49, label %.preheader, label %46

.preheader:                                       ; preds = %43
  %.not65 = icmp eq i64 %26, 0
  br i1 %.not65, label %.loopexit, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader
  %45 = trunc i64 %24 to i32
  br label %55

46:                                               ; preds = %43
  %47 = load ptr, ptr @sb_error_log, align 8
  %.not53 = icmp eq ptr %47, null
  %48 = load ptr, ptr @stderr, align 8
  %49 = select i1 %.not53, ptr %48, ptr %47
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.105) #4
  %51 = load ptr, ptr @sb_error_log, align 8
  %.not54 = icmp eq ptr %51, null
  %52 = load ptr, ptr @stderr, align 8
  %53 = select i1 %.not54, ptr %52, ptr %51
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

55:                                               ; preds = %.lr.ph63, %55
  %.03262 = phi i64 [ 0, %.lr.ph63 ], [ %60, %55 ]
  %56 = getelementptr inbounds double, ptr %30, i64 %.03262
  %57 = load double, ptr %56, align 8, !tbaa !17
  %58 = mul i64 %.03262, %24
  %59 = getelementptr inbounds double, ptr %28, i64 %58
  tail call void @cblas_dscal(i32 noundef %45, double noundef %57, ptr noundef %59, i32 noundef 1) #4
  %60 = add nuw i64 %.03262, 1
  %exitcond67.not = icmp eq i64 %60, %26
  br i1 %exitcond67.not, label %.loopexit, label %55, !llvm.loop !19

61:                                               ; preds = %23
  %62 = getelementptr inbounds i8, ptr %1, i64 16
  %63 = load i8, ptr %62, align 8, !tbaa !15
  %.not42 = icmp eq i8 %63, 99
  br i1 %.not42, label %73, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr @sb_error_log, align 8
  %.not46 = icmp eq ptr %65, null
  %66 = load ptr, ptr @stderr, align 8
  %67 = select i1 %.not46, ptr %66, ptr %65
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.106) #4
  %69 = load ptr, ptr @sb_error_log, align 8
  %.not47 = icmp eq ptr %69, null
  %70 = load ptr, ptr @stderr, align 8
  %71 = select i1 %.not47, ptr %70, ptr %69
  %72 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

73:                                               ; preds = %61
  %74 = load i64, ptr %1, align 8, !tbaa !16
  %.not43 = icmp eq i64 %24, %74
  br i1 %.not43, label %.preheader59, label %77

.preheader59:                                     ; preds = %73
  %.not64 = icmp eq i64 %24, 0
  br i1 %.not64, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader59
  %75 = trunc i64 %26 to i32
  %76 = trunc i64 %24 to i32
  br label %86

77:                                               ; preds = %73
  %78 = load ptr, ptr @sb_error_log, align 8
  %.not44 = icmp eq ptr %78, null
  %79 = load ptr, ptr @stderr, align 8
  %80 = select i1 %.not44, ptr %79, ptr %78
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.107) #4
  %82 = load ptr, ptr @sb_error_log, align 8
  %.not45 = icmp eq ptr %82, null
  %83 = load ptr, ptr @stderr, align 8
  %84 = select i1 %.not45, ptr %83, ptr %82
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

86:                                               ; preds = %.lr.ph, %86
  %.061 = phi i64 [ 0, %.lr.ph ], [ %90, %86 ]
  %87 = getelementptr inbounds double, ptr %30, i64 %.061
  %88 = load double, ptr %87, align 8, !tbaa !17
  %89 = getelementptr inbounds double, ptr %28, i64 %.061
  tail call void @cblas_dscal(i32 noundef %75, double noundef %88, ptr noundef %89, i32 noundef %76) #4
  %90 = add nuw i64 %.061, 1
  %exitcond.not = icmp eq i64 %90, %24
  br i1 %exitcond.not, label %.loopexit, label %86, !llvm.loop !21

91:                                               ; preds = %23
  %92 = load ptr, ptr @sb_error_log, align 8
  %.not57 = icmp eq ptr %92, null
  %93 = load ptr, ptr @stderr, align 8
  %94 = select i1 %.not57, ptr %93, ptr %92
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.108) #4
  %96 = load ptr, ptr @sb_error_log, align 8
  %.not58 = icmp eq ptr %96, null
  %97 = load ptr, ptr @stderr, align 8
  %98 = select i1 %.not58, ptr %97, ptr %96
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

.loopexit:                                        ; preds = %86, %55, %.preheader59, %.preheader
  %100 = tail call i32 @sb_mat_is_finite(ptr noundef nonnull %0)
  %.not50 = icmp eq i32 %100, 0
  br i1 %.not50, label %101, label %110

101:                                              ; preds = %.loopexit
  %102 = load ptr, ptr @sb_error_log, align 8
  %.not51 = icmp eq ptr %102, null
  %103 = load ptr, ptr @stderr, align 8
  %104 = select i1 %.not51, ptr %103, ptr %102
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.109) #4
  %106 = load ptr, ptr @sb_error_log, align 8
  %.not52 = icmp eq ptr %106, null
  %107 = load ptr, ptr @stderr, align 8
  %108 = select i1 %.not52, ptr %107, ptr %106
  %109 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

110:                                              ; preds = %.loopexit
  ret ptr %0
}

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !10, i64 24}
!13 = !{!14, !10, i64 8}
!14 = !{!"", !7, i64 0, !10, i64 8, !8, i64 16}
!15 = !{!14, !8, i64 16}
!16 = !{!14, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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