; 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.110 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.117 = 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_vdiv(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.110) #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.111) #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 %237 [
    i32 99, label %75
    i32 114, label %156
  ]

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.112) #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.113) #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 = %152, %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 %155

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 = fdiv double 1.000000e+00, %145
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = load i64, ptr %11, align 8, !tbaa !13
  %149 = load i64, ptr %7, align 8, !tbaa !13
  %150 = mul i64 %148, %149
  %151 = getelementptr inbounds double, ptr %147, i64 %150
  call void @cblas_dscal(i32 noundef %141, double noundef %146, ptr noundef %151, i32 noundef 1)
  br label %152

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

155:                                              ; preds = %138
  br label %259

156:                                              ; preds = %60
  br label %157

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

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

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

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

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

175:                                              ; preds = %170
  %176 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %179

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

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

182:                                              ; preds = %157
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  br label %185

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

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

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

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

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

205:                                              ; preds = %200
  %206 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %209

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

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

212:                                              ; preds = %185
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %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 = %233, %214
  %216 = load i64, ptr %12, align 8, !tbaa !13
  %217 = load i64, ptr %7, 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 %236

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

233:                                              ; preds = %220
  %234 = load i64, ptr %12, align 8, !tbaa !13
  %235 = add i64 %234, 1
  store i64 %235, ptr %12, align 8, !tbaa !13
  br label %215, !llvm.loop !24

236:                                              ; preds = %219
  br label %259

237:                                              ; preds = %60
  br label %238

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

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

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

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

250:                                              ; preds = %245
  %251 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %254

252:                                              ; preds = %245
  %253 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %254

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

257:                                              ; No predecessors!
  br label %258

258:                                              ; preds = %257
  br label %259

259:                                              ; preds = %258, %236, %155
  br label %260

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

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

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

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

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

276:                                              ; preds = %271
  %277 = load ptr, ptr @sb_error_log, align 8, !tbaa !5
  br label %280

278:                                              ; preds = %271
  %279 = load ptr, ptr @stderr, align 8, !tbaa !5
  br label %280

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

283:                                              ; preds = %260
  br label %284

284:                                              ; preds = %283
  br label %285

285:                                              ; preds = %284
  %286 = 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 %286
}

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.110 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.111 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.112 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.113 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.114 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.115 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.116 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.117 = 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_vdiv(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.110) #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.111) #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 %93 [
    i8 99, label %31
    i8 114, label %62
  ]

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.112) #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.113) #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 ], [ %61, %55 ]
  %56 = getelementptr inbounds double, ptr %30, i64 %.03262
  %57 = load double, ptr %56, align 8, !tbaa !17
  %58 = fdiv double 1.000000e+00, %57
  %59 = mul i64 %.03262, %24
  %60 = getelementptr inbounds double, ptr %28, i64 %59
  tail call void @cblas_dscal(i32 noundef %45, double noundef %58, ptr noundef %60, i32 noundef 1) #4
  %61 = add nuw i64 %.03262, 1
  %exitcond67.not = icmp eq i64 %61, %26
  br i1 %exitcond67.not, label %.loopexit, label %55, !llvm.loop !19

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

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

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

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

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

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

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

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

.loopexit:                                        ; preds = %87, %55, %.preheader59, %.preheader
  %102 = tail call i32 @sb_mat_is_finite(ptr noundef nonnull %0)
  %.not50 = icmp eq i32 %102, 0
  br i1 %.not50, label %103, label %112

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

112:                                              ; 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