; 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.173 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.176 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.177 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.178 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [32 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

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

declare i32 @sb_vec_is_finite(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @sb_mat_sum(ptr noalias noundef %0, ptr noalias noundef %1, i8 noundef signext %2) #4 {
  %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.173) #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.174) #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 %5, 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 %5, 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 %5, 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 %4, 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 %233 [
    i32 99, label %75
    i32 114, label %154
  ]

75:                                               ; preds = %60
  br label %76

76:                                               ; preds = %75
  %77 = load ptr, ptr %4, 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.175) #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_vec, ptr %105, i32 0, i32 0
  %107 = load i64, ptr %106, align 8, !tbaa !19
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.sb_mat, ptr %108, i32 0, i32 1
  %110 = load i64, ptr %109, align 8, !tbaa !14
  %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.176) #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
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = call ptr @sb_vec_set_zero(ptr noundef %134)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !13
  br label %136

136:                                              ; preds = %150, %133
  %137 = load i64, ptr %11, align 8, !tbaa !13
  %138 = load i64, ptr %7, align 8, !tbaa !13
  %139 = icmp ult i64 %137, %138
  br i1 %139, label %141, label %140

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

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

150:                                              ; preds = %141
  %151 = load i64, ptr %11, align 8, !tbaa !13
  %152 = add i64 %151, 1
  store i64 %152, ptr %11, align 8, !tbaa !13
  br label %136, !llvm.loop !20

153:                                              ; preds = %140
  br label %255

154:                                              ; preds = %60
  br label %155

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

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

164:                                              ; preds = %161
  %165 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %168

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

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

173:                                              ; preds = %168
  %174 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %177

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

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

180:                                              ; preds = %155
  br label %181

181:                                              ; preds = %180
  br label %182

182:                                              ; preds = %181
  br label %183

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

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

194:                                              ; preds = %191
  %195 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %198

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

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

203:                                              ; preds = %198
  %204 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %207

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

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

210:                                              ; preds = %183
  br label %211

211:                                              ; preds = %210
  br label %212

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

215:                                              ; preds = %229, %212
  %216 = load i64, ptr %12, align 8, !tbaa !13
  %217 = load i64, ptr %8, align 8, !tbaa !13
  %218 = icmp ult i64 %216, %217
  br i1 %218, label %220, label %219

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

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

229:                                              ; preds = %220
  %230 = load i64, ptr %12, align 8, !tbaa !13
  %231 = add i64 %230, 1
  store i64 %231, ptr %12, align 8, !tbaa !13
  br label %215, !llvm.loop !22

232:                                              ; preds = %219
  br label %255

233:                                              ; preds = %60
  br label %234

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

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

239:                                              ; preds = %234
  %240 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %241

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

246:                                              ; preds = %241
  %247 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %250

248:                                              ; preds = %241
  %249 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %250

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

253:                                              ; No predecessors!
  br label %254

254:                                              ; preds = %253
  br label %255

255:                                              ; preds = %254, %232, %153
  br label %256

256:                                              ; preds = %255
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  %258 = call i32 @sb_vec_is_finite(ptr noundef %257)
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %279, label %260

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

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

265:                                              ; preds = %260
  %266 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %267

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

272:                                              ; preds = %267
  %273 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %276

274:                                              ; preds = %267
  %275 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %276

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

279:                                              ; preds = %256
  br label %280

280:                                              ; preds = %279
  br label %281

281:                                              ; preds = %280
  %282 = 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 %282
}

declare ptr @sb_vec_set_zero(ptr noundef) #3

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 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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.173 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.174 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.175 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.176 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.177 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.178 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [32 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

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

declare i32 @sb_vec_is_finite(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @sb_mat_sum(ptr noalias noundef returned %0, ptr noalias noundef readonly %1, i8 noundef signext %2) local_unnamed_addr #3 {
  %.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.173) #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.174) #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 %1, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %1, i64 8
  %26 = load i64, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %1, i64 24
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %0, 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 %0, 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.175) #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 %0, align 8, !tbaa !16
  %.not49 = icmp eq i64 %44, %26
  br i1 %.not49, label %54, label %45

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

54:                                               ; preds = %43
  %55 = tail call ptr @sb_vec_set_zero(ptr noundef nonnull %0) #4
  %.not64 = icmp eq i64 %24, 0
  br i1 %.not64, label %.loopexit, label %.lr.ph62

.lr.ph62:                                         ; preds = %54
  %56 = trunc i64 %26 to i32
  %57 = trunc i64 %24 to i32
  br label %58

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

61:                                               ; preds = %23
  %62 = getelementptr inbounds i8, ptr %0, 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.177) #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 %0, align 8, !tbaa !16
  %.not43 = icmp eq i64 %74, %24
  br i1 %.not43, label %84, label %75

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

84:                                               ; preds = %73
  %85 = tail call ptr @sb_vec_set_zero(ptr noundef nonnull %0) #4
  %.not63 = icmp eq i64 %26, 0
  br i1 %.not63, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %84
  %86 = trunc i64 %24 to i32
  br label %87

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

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.179) #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 = %87, %58, %84, %54
  %100 = tail call i32 @sb_vec_is_finite(ptr noundef nonnull %0) #4
  %.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.180) #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
}

declare ptr @sb_vec_set_zero(ptr noundef) local_unnamed_addr #2

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 = { "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 = { 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