; 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.86 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.93 = 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

; Function Attrs: nounwind uwtable
define dso_local ptr @sb_mat_vadd(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.86) #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.87) #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 %229 [
    i32 99, label %75
    i32 114, label %152
  ]

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.88) #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.89) #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 = %148, %133
  %135 = load i64, ptr %11, align 8, !tbaa !13
  %136 = load i64, ptr %7, 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 %151

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

148:                                              ; preds = %139
  %149 = load i64, ptr %11, align 8, !tbaa !13
  %150 = add i64 %149, 1
  store i64 %150, ptr %11, align 8, !tbaa !13
  br label %134, !llvm.loop !20

151:                                              ; preds = %138
  br label %251

152:                                              ; preds = %60
  br label %153

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

159:                                              ; preds = %153
  %160 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %164

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

164:                                              ; preds = %159
  %165 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %166

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

171:                                              ; preds = %166
  %172 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %175

173:                                              ; preds = %166
  %174 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %175

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

178:                                              ; preds = %153
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179
  br label %181

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

189:                                              ; preds = %181
  %190 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %191 = icmp ne ptr %190, null
  br i1 %191, label %192, label %194

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

194:                                              ; preds = %189
  %195 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %196

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

201:                                              ; preds = %196
  %202 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %205

203:                                              ; preds = %196
  %204 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %205

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

208:                                              ; preds = %181
  br label %209

209:                                              ; preds = %208
  br label %210

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

211:                                              ; preds = %225, %210
  %212 = load i64, ptr %12, align 8, !tbaa !13
  %213 = load i64, ptr %8, align 8, !tbaa !13
  %214 = icmp ult i64 %212, %213
  br i1 %214, label %216, label %215

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

216:                                              ; preds = %211
  %217 = load i64, ptr %7, align 8, !tbaa !13
  %218 = trunc i64 %217 to i32
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = load i64, ptr %12, align 8, !tbaa !13
  %222 = load i64, ptr %7, align 8, !tbaa !13
  %223 = mul i64 %221, %222
  %224 = getelementptr inbounds double, ptr %220, i64 %223
  call void @cblas_daxpy(i32 noundef %218, double noundef 1.000000e+00, ptr noundef %219, i32 noundef 1, ptr noundef %224, i32 noundef 1)
  br label %225

225:                                              ; preds = %216
  %226 = load i64, ptr %12, align 8, !tbaa !13
  %227 = add i64 %226, 1
  store i64 %227, ptr %12, align 8, !tbaa !13
  br label %211, !llvm.loop !22

228:                                              ; preds = %215
  br label %251

229:                                              ; preds = %60
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %235

233:                                              ; preds = %230
  %234 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %237

235:                                              ; preds = %230
  %236 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %237

237:                                              ; preds = %235, %233
  %238 = phi ptr [ %234, %233 ], [ %236, %235 ]
  %239 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %238, ptr noundef @.str.92) #5
  %240 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %241 = icmp ne ptr %240, null
  br i1 %241, label %242, label %244

242:                                              ; preds = %237
  %243 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %246

244:                                              ; preds = %237
  %245 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %246

246:                                              ; preds = %244, %242
  %247 = phi ptr [ %243, %242 ], [ %245, %244 ]
  %248 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %247, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

249:                                              ; No predecessors!
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250, %228, %151
  br label %252

252:                                              ; preds = %251
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = call i32 @sb_mat_is_finite(ptr noundef %253)
  %255 = icmp ne i32 %254, 0
  br i1 %255, label %275, label %256

256:                                              ; preds = %252
  %257 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %258 = icmp ne ptr %257, null
  br i1 %258, label %259, label %261

259:                                              ; preds = %256
  %260 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %263

261:                                              ; preds = %256
  %262 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %263

263:                                              ; preds = %261, %259
  %264 = phi ptr [ %260, %259 ], [ %262, %261 ]
  %265 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %264, ptr noundef @.str.93) #5
  %266 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  %267 = icmp ne ptr %266, null
  br i1 %267, label %268, label %270

268:                                              ; preds = %263
  %269 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %272

270:                                              ; preds = %263
  %271 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %272

272:                                              ; preds = %270, %268
  %273 = phi ptr [ %269, %268 ], [ %271, %270 ]
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %273, ptr noundef @.str.1) #5
  call void @abort() #6
  unreachable

275:                                              ; preds = %252
  br label %276

276:                                              ; preds = %275
  br label %277

277:                                              ; preds = %276
  %278 = 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 %278
}

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

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 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; 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.86 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.93 = 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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @sb_mat_vadd(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
  %.not35 = icmp eq ptr %5, null
  %6 = load ptr, ptr @stderr, align 8
  %7 = select i1 %.not35, ptr %6, ptr %5
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.86) #4
  %9 = load ptr, ptr @sb_error_log, align 8
  %.not36 = icmp eq ptr %9, null
  %10 = load ptr, ptr @stderr, align 8
  %11 = select i1 %.not36, 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
  %.not37 = icmp eq ptr %1, null
  br i1 %.not37, label %14, label %23

14:                                               ; preds = %13
  %15 = load ptr, ptr @sb_error_log, align 8
  %.not38 = icmp eq ptr %15, null
  %16 = load ptr, ptr @stderr, align 8
  %17 = select i1 %.not38, ptr %16, ptr %15
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.87) #4
  %19 = load ptr, ptr @sb_error_log, align 8
  %.not39 = icmp eq ptr %19, null
  %20 = load ptr, ptr @stderr, align 8
  %21 = select i1 %.not39, 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 %87 [
    i8 99, label %31
    i8 114, label %59
  ]

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

34:                                               ; preds = %31
  %35 = load ptr, ptr @sb_error_log, align 8
  %.not53 = icmp eq ptr %35, null
  %36 = load ptr, ptr @stderr, align 8
  %37 = select i1 %.not53, ptr %36, ptr %35
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.88) #4
  %39 = load ptr, ptr @sb_error_log, align 8
  %.not54 = icmp eq ptr %39, null
  %40 = load ptr, ptr @stderr, align 8
  %41 = select i1 %.not54, 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
  %.not47 = icmp eq i64 %26, %44
  br i1 %.not47, label %.preheader, label %47

.preheader:                                       ; preds = %43
  %.not63 = icmp eq i64 %24, 0
  br i1 %.not63, label %.loopexit, label %.lr.ph61

.lr.ph61:                                         ; preds = %.preheader
  %45 = trunc i64 %26 to i32
  %46 = trunc i64 %24 to i32
  br label %56

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

56:                                               ; preds = %.lr.ph61, %56
  %.03060 = phi i64 [ 0, %.lr.ph61 ], [ %58, %56 ]
  %57 = getelementptr inbounds double, ptr %28, i64 %.03060
  tail call void @cblas_daxpy(i32 noundef %45, double noundef 1.000000e+00, ptr noundef %30, i32 noundef 1, ptr noundef %57, i32 noundef %46) #4
  %58 = add nuw i64 %.03060, 1
  %exitcond65.not = icmp eq i64 %58, %24
  br i1 %exitcond65.not, label %.loopexit, label %56, !llvm.loop !17

59:                                               ; preds = %23
  %60 = getelementptr inbounds i8, ptr %1, i64 16
  %61 = load i8, ptr %60, align 8, !tbaa !15
  %.not40 = icmp eq i8 %61, 99
  br i1 %.not40, label %71, label %62

62:                                               ; preds = %59
  %63 = load ptr, ptr @sb_error_log, align 8
  %.not44 = icmp eq ptr %63, null
  %64 = load ptr, ptr @stderr, align 8
  %65 = select i1 %.not44, ptr %64, ptr %63
  %66 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.90) #4
  %67 = load ptr, ptr @sb_error_log, align 8
  %.not45 = icmp eq ptr %67, null
  %68 = load ptr, ptr @stderr, align 8
  %69 = select i1 %.not45, ptr %68, ptr %67
  %70 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

71:                                               ; preds = %59
  %72 = load i64, ptr %1, align 8, !tbaa !16
  %.not41 = icmp eq i64 %24, %72
  br i1 %.not41, label %.preheader57, label %74

.preheader57:                                     ; preds = %71
  %.not62 = icmp eq i64 %26, 0
  br i1 %.not62, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader57
  %73 = trunc i64 %24 to i32
  br label %83

74:                                               ; preds = %71
  %75 = load ptr, ptr @sb_error_log, align 8
  %.not42 = icmp eq ptr %75, null
  %76 = load ptr, ptr @stderr, align 8
  %77 = select i1 %.not42, ptr %76, ptr %75
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.91) #4
  %79 = load ptr, ptr @sb_error_log, align 8
  %.not43 = icmp eq ptr %79, null
  %80 = load ptr, ptr @stderr, align 8
  %81 = select i1 %.not43, ptr %80, ptr %79
  %82 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

83:                                               ; preds = %.lr.ph, %83
  %.059 = phi i64 [ 0, %.lr.ph ], [ %86, %83 ]
  %84 = mul i64 %.059, %24
  %85 = getelementptr inbounds double, ptr %28, i64 %84
  tail call void @cblas_daxpy(i32 noundef %73, double noundef 1.000000e+00, ptr noundef %30, i32 noundef 1, ptr noundef %85, i32 noundef 1) #4
  %86 = add nuw i64 %.059, 1
  %exitcond.not = icmp eq i64 %86, %26
  br i1 %exitcond.not, label %.loopexit, label %83, !llvm.loop !19

87:                                               ; preds = %23
  %88 = load ptr, ptr @sb_error_log, align 8
  %.not55 = icmp eq ptr %88, null
  %89 = load ptr, ptr @stderr, align 8
  %90 = select i1 %.not55, ptr %89, ptr %88
  %91 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef nonnull @.str.92) #4
  %92 = load ptr, ptr @sb_error_log, align 8
  %.not56 = icmp eq ptr %92, null
  %93 = load ptr, ptr @stderr, align 8
  %94 = select i1 %.not56, ptr %93, ptr %92
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

.loopexit:                                        ; preds = %83, %56, %.preheader57, %.preheader
  %96 = tail call i32 @sb_mat_is_finite(ptr noundef nonnull %0)
  %.not48 = icmp eq i32 %96, 0
  br i1 %.not48, label %97, label %106

97:                                               ; preds = %.loopexit
  %98 = load ptr, ptr @sb_error_log, align 8
  %.not49 = icmp eq ptr %98, null
  %99 = load ptr, ptr @stderr, align 8
  %100 = select i1 %.not49, ptr %99, ptr %98
  %101 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.93) #4
  %102 = load ptr, ptr @sb_error_log, align 8
  %.not50 = icmp eq ptr %102, null
  %103 = load ptr, ptr @stderr, align 8
  %104 = select i1 %.not50, ptr %103, ptr %102
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.1) #4
  tail call void @abort() #5
  unreachable

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

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

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 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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