; LLVM IR from OpenMathLib/OpenBLAS :: relapack/src (sgbtrf)

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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @RELAPACK_sgbtrf(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca [1 x float], align 4
  %19 = alloca i32, align 4
  %20 = alloca [1 x i32], align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 0, ptr %32, align 4, !tbaa !9
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %38

36:                                               ; preds = %8
  %37 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -1, ptr %37, align 4, !tbaa !9
  br label %73

38:                                               ; preds = %8
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %38
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -2, ptr %43, align 4, !tbaa !9
  br label %72

44:                                               ; preds = %38
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %44
  %49 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -3, ptr %49, align 4, !tbaa !9
  br label %71

50:                                               ; preds = %44
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = icmp slt i32 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %50
  %55 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -4, ptr %55, align 4, !tbaa !9
  br label %70

56:                                               ; preds = %50
  %57 = load ptr, ptr %14, align 8, !tbaa !5
  %58 = load i32, ptr %57, align 4, !tbaa !9
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = mul nsw i32 2, %60
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = add nsw i32 %61, %63
  %65 = add nsw i32 %64, 1
  %66 = icmp slt i32 %58, %65
  br i1 %66, label %67, label %69

67:                                               ; preds = %56
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -6, ptr %68, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %67, %56
  br label %70

70:                                               ; preds = %69, %54
  br label %71

71:                                               ; preds = %70, %48
  br label %72

72:                                               ; preds = %71, %42
  br label %73

73:                                               ; preds = %72, %36
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %82

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = sub nsw i32 0, %79
  store i32 %80, ptr %17, align 4, !tbaa !9
  %81 = call i32 @xerbla_(ptr noundef @.str, ptr noundef %17, i32 noundef 6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %278

82:                                               ; preds = %73
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %90, label %86

86:                                               ; preds = %82
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %86, %82
  br label %278

91:                                               ; preds = %86
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = icmp eq i32 %93, 1
  br i1 %94, label %95, label %104

95:                                               ; preds = %91
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = load ptr, ptr %12, align 8, !tbaa !5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  call void @sgbtf2_(ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %99, ptr noundef %100, ptr noundef %101, ptr noundef %102, ptr noundef %103)
  br label %278

104:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.memset.p0.i64(ptr align 4 %18, i8 0, i64 4, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = add nsw i32 %106, %108
  store i32 %109, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = sub nsw i32 %111, 1
  store i32 %112, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load i32, ptr %19, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds float, ptr %113, i64 %115
  store ptr %116, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %157, %104
  %118 = load i32, ptr %23, align 4, !tbaa !9
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %122, label %160

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %123 = load ptr, ptr %21, align 8, !tbaa !5
  %124 = getelementptr inbounds [1 x i32], ptr %20, i64 0, i64 0
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = load i32, ptr %23, align 4, !tbaa !9
  %127 = mul nsw i32 %125, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds float, ptr %123, i64 %128
  store ptr %129, ptr %24, align 8, !tbaa !5
  %130 = load i32, ptr %23, align 4, !tbaa !9
  %131 = load i32, ptr %19, align 4, !tbaa !9
  %132 = sub nsw i32 %130, %131
  %133 = icmp sgt i32 0, %132
  br i1 %133, label %134, label %135

134:                                              ; preds = %122
  br label %139

135:                                              ; preds = %122
  %136 = load i32, ptr %23, align 4, !tbaa !9
  %137 = load i32, ptr %19, align 4, !tbaa !9
  %138 = sub nsw i32 %136, %137
  br label %139

139:                                              ; preds = %135, %134
  %140 = phi i32 [ 0, %134 ], [ %138, %135 ]
  store i32 %140, ptr %22, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %153, %139
  %142 = load i32, ptr %22, align 4, !tbaa !9
  %143 = load i32, ptr %23, align 4, !tbaa !9
  %144 = load ptr, ptr %12, align 8, !tbaa !5
  %145 = load i32, ptr %144, align 4, !tbaa !9
  %146 = sub nsw i32 %143, %145
  %147 = icmp slt i32 %142, %146
  br i1 %147, label %148, label %156

148:                                              ; preds = %141
  %149 = load ptr, ptr %24, align 8, !tbaa !5
  %150 = load i32, ptr %22, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds float, ptr %149, i64 %151
  store float 0.000000e+00, ptr %152, align 4, !tbaa !11
  br label %153

153:                                              ; preds = %148
  %154 = load i32, ptr %22, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %22, align 4, !tbaa !9
  br label %141, !llvm.loop !13

156:                                              ; preds = %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %23, align 4, !tbaa !9
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %23, align 4, !tbaa !9
  br label %117, !llvm.loop !15

160:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = load i32, ptr %161, align 4, !tbaa !9
  %163 = icmp sge i32 %162, 32
  br i1 %163, label %164, label %170

164:                                              ; preds = %160
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = add nsw i32 %166, 16
  %168 = sdiv i32 %167, 32
  %169 = mul nsw i32 %168, 16
  br label %174

170:                                              ; preds = %160
  %171 = load ptr, ptr %10, align 8, !tbaa !5
  %172 = load i32, ptr %171, align 4, !tbaa !9
  %173 = sdiv i32 %172, 2
  br label %174

174:                                              ; preds = %170, %164
  %175 = phi i32 [ %169, %164 ], [ %173, %170 ]
  store i32 %175, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %176 = load i32, ptr %19, align 4, !tbaa !9
  %177 = load i32, ptr %25, align 4, !tbaa !9
  %178 = icmp sgt i32 %176, %177
  br i1 %178, label %179, label %195

179:                                              ; preds = %174
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = load i32, ptr %182, align 4, !tbaa !9
  %184 = sub nsw i32 %181, %183
  %185 = icmp sgt i32 1, %184
  br i1 %185, label %186, label %187

186:                                              ; preds = %179
  br label %193

187:                                              ; preds = %179
  %188 = load ptr, ptr %9, align 8, !tbaa !5
  %189 = load i32, ptr %188, align 4, !tbaa !9
  %190 = load ptr, ptr %11, align 8, !tbaa !5
  %191 = load i32, ptr %190, align 4, !tbaa !9
  %192 = sub nsw i32 %189, %191
  br label %193

193:                                              ; preds = %187, %186
  %194 = phi i32 [ 1, %186 ], [ %192, %187 ]
  br label %197

195:                                              ; preds = %174
  %196 = load i32, ptr %19, align 4, !tbaa !9
  br label %197

197:                                              ; preds = %195, %193
  %198 = phi i32 [ %194, %193 ], [ %196, %195 ]
  %199 = call i32 @llvm.abs.i32(i32 %198, i1 true)
  store i32 %199, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %200 = load i32, ptr %19, align 4, !tbaa !9
  %201 = load i32, ptr %25, align 4, !tbaa !9
  %202 = icmp sgt i32 %200, %201
  br i1 %202, label %203, label %205

203:                                              ; preds = %197
  %204 = load i32, ptr %25, align 4, !tbaa !9
  br label %207

205:                                              ; preds = %197
  %206 = load i32, ptr %19, align 4, !tbaa !9
  br label %207

207:                                              ; preds = %205, %203
  %208 = phi i32 [ %204, %203 ], [ %206, %205 ]
  %209 = call i32 @llvm.abs.i32(i32 %208, i1 true)
  store i32 %209, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %210 = load ptr, ptr %11, align 8, !tbaa !5
  %211 = load i32, ptr %210, align 4, !tbaa !9
  %212 = load i32, ptr %25, align 4, !tbaa !9
  %213 = icmp sgt i32 %211, %212
  br i1 %213, label %214, label %216

214:                                              ; preds = %207
  %215 = load i32, ptr %25, align 4, !tbaa !9
  br label %219

216:                                              ; preds = %207
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = load i32, ptr %217, align 4, !tbaa !9
  br label %219

219:                                              ; preds = %216, %214
  %220 = phi i32 [ %215, %214 ], [ %218, %216 ]
  %221 = call i32 @llvm.abs.i32(i32 %220, i1 true)
  store i32 %221, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  %222 = load ptr, ptr %11, align 8, !tbaa !5
  %223 = load i32, ptr %222, align 4, !tbaa !9
  %224 = load i32, ptr %25, align 4, !tbaa !9
  %225 = icmp sgt i32 %223, %224
  br i1 %225, label %226, label %242

226:                                              ; preds = %219
  %227 = load ptr, ptr %10, align 8, !tbaa !5
  %228 = load i32, ptr %227, align 4, !tbaa !9
  %229 = load ptr, ptr %11, align 8, !tbaa !5
  %230 = load i32, ptr %229, align 4, !tbaa !9
  %231 = sub nsw i32 %228, %230
  %232 = icmp sgt i32 0, %231
  br i1 %232, label %233, label %234

233:                                              ; preds = %226
  br label %240

234:                                              ; preds = %226
  %235 = load ptr, ptr %10, align 8, !tbaa !5
  %236 = load i32, ptr %235, align 4, !tbaa !9
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  %238 = load i32, ptr %237, align 4, !tbaa !9
  %239 = sub nsw i32 %236, %238
  br label %240

240:                                              ; preds = %234, %233
  %241 = phi i32 [ 0, %233 ], [ %239, %234 ]
  br label %245

242:                                              ; preds = %219
  %243 = load ptr, ptr %11, align 8, !tbaa !5
  %244 = load i32, ptr %243, align 4, !tbaa !9
  br label %245

245:                                              ; preds = %242, %240
  %246 = phi i32 [ %241, %240 ], [ %244, %242 ]
  %247 = call i32 @llvm.abs.i32(i32 %246, i1 true)
  store i32 %247, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  %248 = load i32, ptr %26, align 4, !tbaa !9
  %249 = load i32, ptr %27, align 4, !tbaa !9
  %250 = mul nsw i32 %248, %249
  %251 = sext i32 %250 to i64
  %252 = mul i64 %251, 4
  %253 = call noalias ptr @malloc(i64 noundef %252) #8
  store ptr %253, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #7
  %254 = load i32, ptr %28, align 4, !tbaa !9
  %255 = load i32, ptr %29, align 4, !tbaa !9
  %256 = mul nsw i32 %254, %255
  %257 = sext i32 %256 to i64
  %258 = mul i64 %257, 4
  %259 = call noalias ptr @malloc(i64 noundef %258) #8
  store ptr %259, ptr %31, align 8, !tbaa !5
  %260 = getelementptr inbounds [1 x float], ptr %18, i64 0, i64 0
  %261 = getelementptr inbounds [1 x float], ptr %18, i64 0, i64 0
  %262 = load ptr, ptr %30, align 8, !tbaa !5
  call void @slaset_(ptr noundef @.str.1, ptr noundef %26, ptr noundef %27, ptr noundef %260, ptr noundef %261, ptr noundef %262, ptr noundef %26)
  %263 = getelementptr inbounds [1 x float], ptr %18, i64 0, i64 0
  %264 = getelementptr inbounds [1 x float], ptr %18, i64 0, i64 0
  %265 = load ptr, ptr %31, align 8, !tbaa !5
  call void @slaset_(ptr noundef @.str.2, ptr noundef %28, ptr noundef %29, ptr noundef %263, ptr noundef %264, ptr noundef %265, ptr noundef %28)
  %266 = load ptr, ptr %9, align 8, !tbaa !5
  %267 = load ptr, ptr %10, align 8, !tbaa !5
  %268 = load ptr, ptr %11, align 8, !tbaa !5
  %269 = load ptr, ptr %12, align 8, !tbaa !5
  %270 = load ptr, ptr %13, align 8, !tbaa !5
  %271 = load ptr, ptr %14, align 8, !tbaa !5
  %272 = load ptr, ptr %15, align 8, !tbaa !5
  %273 = load ptr, ptr %30, align 8, !tbaa !5
  %274 = load ptr, ptr %31, align 8, !tbaa !5
  %275 = load ptr, ptr %16, align 8, !tbaa !5
  call void @RELAPACK_sgbtrf_rec(ptr noundef %266, ptr noundef %267, ptr noundef %268, ptr noundef %269, ptr noundef %270, ptr noundef %271, ptr noundef %272, ptr noundef %273, ptr noundef %26, ptr noundef %274, ptr noundef %28, ptr noundef %275)
  %276 = load ptr, ptr %30, align 8, !tbaa !5
  call void @free(ptr noundef %276) #7
  %277 = load ptr, ptr %31, align 8, !tbaa !5
  call void @free(ptr noundef %277) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %278

278:                                              ; preds = %245, %95, %90, %77
  ret void
}

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

declare i32 @xerbla_(ptr noundef, ptr noundef, i32 noundef) #2

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

declare void @sgbtf2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

declare void @slaset_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @RELAPACK_sgbtrf_rec(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @RELAPACK_sgbtrf(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #0 {
  %9 = alloca i32, align 4
  %10 = alloca [1 x float], align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %7, align 4, !tbaa !5
  %15 = load i32, ptr %0, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %.thread, label %17

17:                                               ; preds = %8
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 0
  br i1 %19, label %.thread, label %20

20:                                               ; preds = %17
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %.thread, label %23

23:                                               ; preds = %20
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp slt i32 %24, 0
  br i1 %25, label %.thread, label %26

26:                                               ; preds = %23
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = shl nuw nsw i32 %21, 1
  %29 = add nuw nsw i32 %24, %28
  %.not = icmp sgt i32 %27, %29
  br i1 %.not, label %31, label %.thread

.thread:                                          ; preds = %26, %23, %20, %17, %8
  %.sink = phi i32 [ -1, %8 ], [ -2, %17 ], [ -3, %20 ], [ -4, %23 ], [ -6, %26 ]
  %.neg = phi i32 [ 1, %8 ], [ 2, %17 ], [ 3, %20 ], [ 4, %23 ], [ 6, %26 ]
  store i32 %.sink, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  store i32 %.neg, ptr %9, align 4, !tbaa !5
  %30 = call i32 @xerbla_(ptr noundef nonnull @.str, ptr noundef nonnull %9, i32 noundef 6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  br label %85

31:                                               ; preds = %26
  %32 = icmp eq i32 %15, 0
  %33 = icmp eq i32 %18, 0
  %or.cond = or i1 %32, %33
  br i1 %or.cond, label %85, label %34

34:                                               ; preds = %31
  %35 = icmp eq i32 %27, 1
  br i1 %35, label %36, label %.lr.ph100.preheader

36:                                               ; preds = %34
  tail call void @sgbtf2_(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef %4, ptr noundef nonnull %5, ptr noundef %6, ptr noundef nonnull %7) #8
  br label %85

.lr.ph100.preheader:                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  store i32 0, ptr %10, align 4
  %37 = add nuw i32 %21, %24
  %38 = add nsw i32 %27, -1
  %39 = sext i32 %37 to i64
  %40 = shl nsw i64 %39, 2
  %scevgep = getelementptr i8, ptr %4, i64 %40
  %41 = xor i32 %24, -1
  %42 = zext nneg i32 %24 to i64
  %wide.trip.count = zext nneg i32 %18 to i64
  br label %.lr.ph100

.lr.ph100:                                        ; preds = %.lr.ph100.preheader, %._crit_edge
  %indvars.iv107 = phi i64 [ 0, %.lr.ph100.preheader ], [ %indvars.iv.next108, %._crit_edge ]
  %43 = trunc i64 %indvars.iv107 to i32
  %44 = sub i32 %43, %37
  %45 = tail call i32 @llvm.smax.i32(i32 %44, i32 0)
  %46 = sub nsw i64 %indvars.iv107, %42
  %47 = zext nneg i32 %45 to i64
  %48 = icmp sgt i64 %46, %47
  br i1 %48, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph100
  %49 = trunc nuw nsw i64 %indvars.iv107 to i32
  %50 = add i32 %41, %49
  %51 = trunc i64 %indvars.iv107 to i32
  %52 = sub i32 %51, %37
  %smax = tail call i32 @llvm.smax.i32(i32 %52, i32 0)
  %53 = sub i32 %50, %smax
  %54 = zext i32 %53 to i64
  %55 = shl nuw nsw i64 %54, 2
  %56 = add nuw nsw i64 %55, 4
  %57 = mul i32 %38, %49
  %58 = sext i32 %57 to i64
  %59 = zext nneg i32 %smax to i64
  %60 = add nsw i64 %58, %59
  %61 = shl nsw i64 %60, 2
  %scevgep102 = getelementptr i8, ptr %scevgep, i64 %61
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep102, i8 0, i64 %56, i1 false), !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.lr.ph100
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge101, label %.lr.ph100, !llvm.loop !11

._crit_edge101:                                   ; preds = %._crit_edge
  %62 = icmp sgt i32 %18, 31
  %63 = add nuw nsw i32 %18, 16
  %64 = lshr i32 %63, 1
  %65 = and i32 %64, 1073741808
  %66 = lshr i32 %18, 1
  %67 = select i1 %62, i32 %65, i32 %66
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  %68 = icmp sgt i32 %37, %67
  %69 = sub nsw i32 %15, %21
  %spec.select = tail call i32 @llvm.smax.i32(i32 %69, i32 1)
  %70 = select i1 %68, i32 %spec.select, i32 %37
  %71 = tail call i32 @llvm.abs.i32(i32 %70, i1 true)
  store i32 %71, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %72 = tail call i32 @llvm.smin.i32(i32 %37, i32 %67)
  %73 = tail call i32 @llvm.abs.i32(i32 %72, i1 true)
  store i32 %73, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #8
  %74 = icmp sgt i32 %21, %67
  %. = tail call i32 @llvm.smin.i32(i32 %21, i32 %67)
  store i32 %., ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #8
  %75 = sub nsw i32 %18, %21
  %spec.select95 = tail call i32 @llvm.smax.i32(i32 %75, i32 0)
  %76 = select i1 %74, i32 %spec.select95, i32 %21
  store i32 %76, ptr %14, align 4, !tbaa !5
  %77 = mul nuw nsw i32 %71, %73
  %78 = zext nneg i32 %77 to i64
  %79 = shl nuw nsw i64 %78, 2
  %80 = tail call noalias ptr @malloc(i64 noundef %79) #9
  %81 = mul nuw nsw i32 %76, %.
  %82 = zext nneg i32 %81 to i64
  %83 = shl nuw nsw i64 %82, 2
  %84 = tail call noalias ptr @malloc(i64 noundef %83) #9
  call void @slaset_(ptr noundef nonnull @.str.1, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %10, ptr noundef nonnull %10, ptr noundef %80, ptr noundef nonnull %11) #8
  call void @slaset_(ptr noundef nonnull @.str.2, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %10, ptr noundef nonnull %10, ptr noundef %84, ptr noundef nonnull %13) #8
  call void @RELAPACK_sgbtrf_rec(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef %4, ptr noundef nonnull %5, ptr noundef %6, ptr noundef %80, ptr noundef nonnull %11, ptr noundef %84, ptr noundef nonnull %13, ptr noundef nonnull %7)
  call void @free(ptr noundef %80) #8
  call void @free(ptr noundef %84) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  br label %85

85:                                               ; preds = %31, %._crit_edge101, %36, %.thread
  ret void
}

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

declare i32 @xerbla_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare void @sgbtf2_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

declare void @slaset_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @RELAPACK_sgbtrf_rec(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass