; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/LAPACK/VARIANTS/cholesky/TOP (cpotrf)

; 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.complex = type { float, float }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@c__1 = external hidden global i64, align 8
@c_n1 = external hidden global i64, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@c_b1 = external hidden global %struct.complex, align 4
@c_b18 = external hidden global float, align 4
@c_b19 = external hidden global float, align 4
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cpotrf_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = load i64, ptr %23, align 8, !tbaa !9
  store i64 %24, ptr %12, align 8, !tbaa !9
  %25 = load i64, ptr %12, align 8, !tbaa !9
  %26 = add nsw i64 1, %25
  store i64 %26, ptr %13, align 8, !tbaa !9
  %27 = load i64, ptr %13, align 8, !tbaa !9
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = sub i64 0, %27
  %30 = getelementptr inbounds %struct.complex, ptr %28, i64 %29
  store ptr %30, ptr %9, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 0, ptr %31, align 8, !tbaa !9
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = call i64 @lsame_(ptr noundef %32, ptr noundef @.str)
  store i64 %33, ptr %21, align 8, !tbaa !9
  %34 = load i64, ptr %21, align 8, !tbaa !9
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %42, label %36

36:                                               ; preds = %5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call i64 @lsame_(ptr noundef %37, ptr noundef @.str.1)
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %42, label %40

40:                                               ; preds = %36
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 -1, ptr %41, align 8, !tbaa !9
  br label %65

42:                                               ; preds = %36, %5
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = icmp slt i64 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %42
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 -2, ptr %47, align 8, !tbaa !9
  br label %64

48:                                               ; preds = %42
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = load i64, ptr %51, align 8, !tbaa !9
  %53 = icmp sge i64 1, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %48
  br label %58

55:                                               ; preds = %48
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load i64, ptr %56, align 8, !tbaa !9
  br label %58

58:                                               ; preds = %55, %54
  %59 = phi i64 [ 1, %54 ], [ %57, %55 ]
  %60 = icmp slt i64 %50, %59
  br i1 %60, label %61, label %63

61:                                               ; preds = %58
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 -4, ptr %62, align 8, !tbaa !9
  br label %63

63:                                               ; preds = %61, %58
  br label %64

64:                                               ; preds = %63, %46
  br label %65

65:                                               ; preds = %64, %40
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %74

69:                                               ; preds = %65
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = sub nsw i64 0, %71
  store i64 %72, ptr %14, align 8, !tbaa !9
  %73 = call i32 @xerbla_(ptr noundef @.str.2, ptr noundef %14)
  store i32 0, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %288

74:                                               ; preds = %65
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %78, label %79

78:                                               ; preds = %74
  store i32 0, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %288

79:                                               ; preds = %74
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = call i64 @ilaenv_(ptr noundef @c__1, ptr noundef @.str.2, ptr noundef %80, ptr noundef %81, ptr noundef @c_n1, ptr noundef @c_n1, ptr noundef @c_n1)
  store i64 %82, ptr %20, align 8, !tbaa !9
  %83 = load i64, ptr %20, align 8, !tbaa !9
  %84 = icmp sle i64 %83, 1
  br i1 %84, label %90, label %85

85:                                               ; preds = %79
  %86 = load i64, ptr %20, align 8, !tbaa !9
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = load i64, ptr %87, align 8, !tbaa !9
  %89 = icmp sge i64 %86, %88
  br i1 %89, label %90, label %99

90:                                               ; preds = %85, %79
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i64, ptr %13, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.complex, ptr %93, i64 %94
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = call i32 @cpotf2_(ptr noundef %91, ptr noundef %92, ptr noundef %95, ptr noundef %96, ptr noundef %97)
  br label %279

99:                                               ; preds = %85
  %100 = load i64, ptr %21, align 8, !tbaa !9
  %101 = icmp ne i64 %100, 0
  br i1 %101, label %102, label %191

102:                                              ; preds = %99
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = load i64, ptr %103, align 8, !tbaa !9
  store i64 %104, ptr %14, align 8, !tbaa !9
  %105 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %105, ptr %15, align 8, !tbaa !9
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %186, %102
  %107 = load i64, ptr %15, align 8, !tbaa !9
  %108 = icmp slt i64 %107, 0
  br i1 %108, label %109, label %114

109:                                              ; preds = %106
  %110 = load i64, ptr %18, align 8, !tbaa !9
  %111 = load i64, ptr %14, align 8, !tbaa !9
  %112 = icmp sge i64 %110, %111
  %113 = zext i1 %112 to i32
  br label %119

114:                                              ; preds = %106
  %115 = load i64, ptr %18, align 8, !tbaa !9
  %116 = load i64, ptr %14, align 8, !tbaa !9
  %117 = icmp sle i64 %115, %116
  %118 = zext i1 %117 to i32
  br label %119

119:                                              ; preds = %114, %109
  %120 = phi i32 [ %113, %109 ], [ %118, %114 ]
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %190

122:                                              ; preds = %119
  %123 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %123, ptr %16, align 8, !tbaa !9
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i64, ptr %18, align 8, !tbaa !9
  %127 = sub nsw i64 %125, %126
  %128 = add nsw i64 %127, 1
  store i64 %128, ptr %17, align 8, !tbaa !9
  %129 = load i64, ptr %16, align 8, !tbaa !9
  %130 = load i64, ptr %17, align 8, !tbaa !9
  %131 = icmp sle i64 %129, %130
  br i1 %131, label %132, label %134

132:                                              ; preds = %122
  %133 = load i64, ptr %16, align 8, !tbaa !9
  br label %136

134:                                              ; preds = %122
  %135 = load i64, ptr %17, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %134, %132
  %137 = phi i64 [ %133, %132 ], [ %135, %134 ]
  store i64 %137, ptr %19, align 8, !tbaa !9
  %138 = load i64, ptr %18, align 8, !tbaa !9
  %139 = sub nsw i64 %138, 1
  store i64 %139, ptr %16, align 8, !tbaa !9
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = load i64, ptr %12, align 8, !tbaa !9
  %142 = add nsw i64 %141, 1
  %143 = getelementptr inbounds %struct.complex, ptr %140, i64 %142
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load i64, ptr %18, align 8, !tbaa !9
  %147 = load i64, ptr %12, align 8, !tbaa !9
  %148 = mul nsw i64 %146, %147
  %149 = add nsw i64 %148, 1
  %150 = getelementptr inbounds %struct.complex, ptr %145, i64 %149
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = call i32 @f2c_ctrsm(ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef %16, ptr noundef %19, ptr noundef @c_b1, ptr noundef %143, ptr noundef %144, ptr noundef %150, ptr noundef %151)
  %153 = load i64, ptr %18, align 8, !tbaa !9
  %154 = sub nsw i64 %153, 1
  store i64 %154, ptr %16, align 8, !tbaa !9
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = load i64, ptr %18, align 8, !tbaa !9
  %157 = load i64, ptr %12, align 8, !tbaa !9
  %158 = mul nsw i64 %156, %157
  %159 = add nsw i64 %158, 1
  %160 = getelementptr inbounds %struct.complex, ptr %155, i64 %159
  %161 = load ptr, ptr %10, align 8, !tbaa !5
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = load i64, ptr %18, align 8, !tbaa !9
  %164 = load i64, ptr %18, align 8, !tbaa !9
  %165 = load i64, ptr %12, align 8, !tbaa !9
  %166 = mul nsw i64 %164, %165
  %167 = add nsw i64 %163, %166
  %168 = getelementptr inbounds %struct.complex, ptr %162, i64 %167
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = call i32 @f2c_cherk(ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef %19, ptr noundef %16, ptr noundef @c_b18, ptr noundef %160, ptr noundef %161, ptr noundef @c_b19, ptr noundef %168, ptr noundef %169)
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = load i64, ptr %18, align 8, !tbaa !9
  %173 = load i64, ptr %18, align 8, !tbaa !9
  %174 = load i64, ptr %12, align 8, !tbaa !9
  %175 = mul nsw i64 %173, %174
  %176 = add nsw i64 %172, %175
  %177 = getelementptr inbounds %struct.complex, ptr %171, i64 %176
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = call i32 @cpotf2_(ptr noundef @.str.4, ptr noundef %19, ptr noundef %177, ptr noundef %178, ptr noundef %179)
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = load i64, ptr %181, align 8, !tbaa !9
  %183 = icmp ne i64 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %136
  br label %280

185:                                              ; preds = %136
  br label %186

186:                                              ; preds = %185
  %187 = load i64, ptr %15, align 8, !tbaa !9
  %188 = load i64, ptr %18, align 8, !tbaa !9
  %189 = add nsw i64 %188, %187
  store i64 %189, ptr %18, align 8, !tbaa !9
  br label %106, !llvm.loop !11

190:                                              ; preds = %119
  br label %278

191:                                              ; preds = %99
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  %193 = load i64, ptr %192, align 8, !tbaa !9
  store i64 %193, ptr %15, align 8, !tbaa !9
  %194 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %194, ptr %14, align 8, !tbaa !9
  store i64 1, ptr %18, align 8, !tbaa !9
  br label %195

195:                                              ; preds = %273, %191
  %196 = load i64, ptr %14, align 8, !tbaa !9
  %197 = icmp slt i64 %196, 0
  br i1 %197, label %198, label %203

198:                                              ; preds = %195
  %199 = load i64, ptr %18, align 8, !tbaa !9
  %200 = load i64, ptr %15, align 8, !tbaa !9
  %201 = icmp sge i64 %199, %200
  %202 = zext i1 %201 to i32
  br label %208

203:                                              ; preds = %195
  %204 = load i64, ptr %18, align 8, !tbaa !9
  %205 = load i64, ptr %15, align 8, !tbaa !9
  %206 = icmp sle i64 %204, %205
  %207 = zext i1 %206 to i32
  br label %208

208:                                              ; preds = %203, %198
  %209 = phi i32 [ %202, %198 ], [ %207, %203 ]
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %277

211:                                              ; preds = %208
  %212 = load i64, ptr %20, align 8, !tbaa !9
  store i64 %212, ptr %16, align 8, !tbaa !9
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = load i64, ptr %213, align 8, !tbaa !9
  %215 = load i64, ptr %18, align 8, !tbaa !9
  %216 = sub nsw i64 %214, %215
  %217 = add nsw i64 %216, 1
  store i64 %217, ptr %17, align 8, !tbaa !9
  %218 = load i64, ptr %16, align 8, !tbaa !9
  %219 = load i64, ptr %17, align 8, !tbaa !9
  %220 = icmp sle i64 %218, %219
  br i1 %220, label %221, label %223

221:                                              ; preds = %211
  %222 = load i64, ptr %16, align 8, !tbaa !9
  br label %225

223:                                              ; preds = %211
  %224 = load i64, ptr %17, align 8, !tbaa !9
  br label %225

225:                                              ; preds = %223, %221
  %226 = phi i64 [ %222, %221 ], [ %224, %223 ]
  store i64 %226, ptr %19, align 8, !tbaa !9
  %227 = load i64, ptr %18, align 8, !tbaa !9
  %228 = sub nsw i64 %227, 1
  store i64 %228, ptr %16, align 8, !tbaa !9
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = load i64, ptr %12, align 8, !tbaa !9
  %231 = add nsw i64 %230, 1
  %232 = getelementptr inbounds %struct.complex, ptr %229, i64 %231
  %233 = load ptr, ptr %10, align 8, !tbaa !5
  %234 = load ptr, ptr %9, align 8, !tbaa !5
  %235 = load i64, ptr %18, align 8, !tbaa !9
  %236 = load i64, ptr %12, align 8, !tbaa !9
  %237 = add nsw i64 %235, %236
  %238 = getelementptr inbounds %struct.complex, ptr %234, i64 %237
  %239 = load ptr, ptr %10, align 8, !tbaa !5
  %240 = call i32 @f2c_ctrsm(ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef %19, ptr noundef %16, ptr noundef @c_b1, ptr noundef %232, ptr noundef %233, ptr noundef %238, ptr noundef %239)
  %241 = load i64, ptr %18, align 8, !tbaa !9
  %242 = sub nsw i64 %241, 1
  store i64 %242, ptr %16, align 8, !tbaa !9
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = load i64, ptr %18, align 8, !tbaa !9
  %245 = load i64, ptr %12, align 8, !tbaa !9
  %246 = add nsw i64 %244, %245
  %247 = getelementptr inbounds %struct.complex, ptr %243, i64 %246
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = load ptr, ptr %9, align 8, !tbaa !5
  %250 = load i64, ptr %18, align 8, !tbaa !9
  %251 = load i64, ptr %18, align 8, !tbaa !9
  %252 = load i64, ptr %12, align 8, !tbaa !9
  %253 = mul nsw i64 %251, %252
  %254 = add nsw i64 %250, %253
  %255 = getelementptr inbounds %struct.complex, ptr %249, i64 %254
  %256 = load ptr, ptr %10, align 8, !tbaa !5
  %257 = call i32 @f2c_cherk(ptr noundef @.str.8, ptr noundef @.str.9, ptr noundef %19, ptr noundef %16, ptr noundef @c_b18, ptr noundef %247, ptr noundef %248, ptr noundef @c_b19, ptr noundef %255, ptr noundef %256)
  %258 = load ptr, ptr %9, align 8, !tbaa !5
  %259 = load i64, ptr %18, align 8, !tbaa !9
  %260 = load i64, ptr %18, align 8, !tbaa !9
  %261 = load i64, ptr %12, align 8, !tbaa !9
  %262 = mul nsw i64 %260, %261
  %263 = add nsw i64 %259, %262
  %264 = getelementptr inbounds %struct.complex, ptr %258, i64 %263
  %265 = load ptr, ptr %10, align 8, !tbaa !5
  %266 = load ptr, ptr %11, align 8, !tbaa !5
  %267 = call i32 @cpotf2_(ptr noundef @.str.8, ptr noundef %19, ptr noundef %264, ptr noundef %265, ptr noundef %266)
  %268 = load ptr, ptr %11, align 8, !tbaa !5
  %269 = load i64, ptr %268, align 8, !tbaa !9
  %270 = icmp ne i64 %269, 0
  br i1 %270, label %271, label %272

271:                                              ; preds = %225
  br label %280

272:                                              ; preds = %225
  br label %273

273:                                              ; preds = %272
  %274 = load i64, ptr %14, align 8, !tbaa !9
  %275 = load i64, ptr %18, align 8, !tbaa !9
  %276 = add nsw i64 %275, %274
  store i64 %276, ptr %18, align 8, !tbaa !9
  br label %195, !llvm.loop !13

277:                                              ; preds = %208
  br label %278

278:                                              ; preds = %277, %190
  br label %279

279:                                              ; preds = %278, %90
  br label %287

280:                                              ; preds = %271, %184
  %281 = load ptr, ptr %11, align 8, !tbaa !5
  %282 = load i64, ptr %281, align 8, !tbaa !9
  %283 = load i64, ptr %18, align 8, !tbaa !9
  %284 = add nsw i64 %282, %283
  %285 = sub nsw i64 %284, 1
  %286 = load ptr, ptr %11, align 8, !tbaa !5
  store i64 %285, ptr %286, align 8, !tbaa !9
  br label %287

287:                                              ; preds = %280, %279
  store i32 0, ptr %6, align 4
  store i32 1, ptr %22, align 4
  br label %288

288:                                              ; preds = %287, %78, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %289 = load i32, ptr %6, align 4
  ret i32 %289
}

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

declare i64 @lsame_(ptr noundef, ptr noundef) #2

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

declare i64 @ilaenv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

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

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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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

%struct.complex = type { float, float }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@c__1 = external hidden global i64, align 8
@c_n1 = external hidden global i64, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@c_b1 = external hidden global %struct.complex, align 4
@c_b18 = external hidden global float, align 4
@c_b19 = external hidden global float, align 4
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @cpotrf_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  %9 = load i64, ptr %3, align 8, !tbaa !5
  %10 = xor i64 %9, -1
  %11 = getelementptr inbounds %struct.complex, ptr %2, i64 %10
  store i64 0, ptr %4, align 8, !tbaa !5
  %12 = tail call i64 @lsame_(ptr noundef %0, ptr noundef nonnull @.str) #4
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %13, label %15

13:                                               ; preds = %5
  %14 = tail call i64 @lsame_(ptr noundef %0, ptr noundef nonnull @.str.1) #4
  %.not111 = icmp eq i64 %14, 0
  br i1 %.not111, label %.thread.sink.split, label %15

15:                                               ; preds = %13, %5
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp slt i64 %16, 0
  br i1 %17, label %.thread.sink.split, label %18

18:                                               ; preds = %15
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %spec.select = tail call i64 @llvm.umax.i64(i64 %16, i64 1)
  %20 = icmp slt i64 %19, %spec.select
  br i1 %20, label %.thread.sink.split, label %21

21:                                               ; preds = %18
  %.pr = load i64, ptr %4, align 8, !tbaa !5
  %.not112 = icmp eq i64 %.pr, 0
  br i1 %.not112, label %25, label %.thread

.thread.sink.split:                               ; preds = %18, %15, %13
  %.sink = phi i64 [ -1, %13 ], [ -2, %15 ], [ -4, %18 ]
  store i64 %.sink, ptr %4, align 8, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %21
  %22 = phi i64 [ %.pr, %21 ], [ %.sink, %.thread.sink.split ]
  %23 = sub nsw i64 0, %22
  store i64 %23, ptr %6, align 8, !tbaa !5
  %24 = call i32 @xerbla_(ptr noundef nonnull @.str.2, ptr noundef nonnull %6) #4
  br label %.loopexit

25:                                               ; preds = %21
  %26 = icmp eq i64 %16, 0
  br i1 %26, label %.loopexit, label %27

27:                                               ; preds = %25
  %28 = tail call i64 @ilaenv_(ptr noundef nonnull @c__1, ptr noundef nonnull @.str.2, ptr noundef %0, ptr noundef nonnull %1, ptr noundef nonnull @c_n1, ptr noundef nonnull @c_n1, ptr noundef nonnull @c_n1) #4
  %29 = icmp slt i64 %28, 2
  br i1 %29, label %32, label %30

30:                                               ; preds = %27
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %.not113 = icmp slt i64 %28, %31
  br i1 %.not113, label %34, label %32

32:                                               ; preds = %30, %27
  %33 = tail call i32 @cpotf2_(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  br label %.loopexit

34:                                               ; preds = %30
  br i1 %.not, label %.lr.ph131, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %34
  %invariant.gep = getelementptr i8, ptr %11, i64 8
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %46
  %.0107126 = phi i64 [ %47, %46 ], [ 1, %.lr.ph.preheader ]
  %35 = load i64, ptr %1, align 8, !tbaa !5
  %reass.sub = sub i64 %35, %.0107126
  %36 = add i64 %reass.sub, 1
  %37 = call i64 @llvm.smin.i64(i64 %28, i64 %36)
  store i64 %37, ptr %8, align 8, !tbaa !5
  %38 = add nsw i64 %.0107126, -1
  store i64 %38, ptr %7, align 8, !tbaa !5
  %39 = mul nsw i64 %.0107126, %9
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %39
  %40 = call i32 @f2c_ctrsm(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull @c_b1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %gep, ptr noundef nonnull %3) #4
  store i64 %38, ptr %7, align 8, !tbaa !5
  %41 = getelementptr %struct.complex, ptr %11, i64 %.0107126
  %42 = getelementptr %struct.complex, ptr %41, i64 %39
  %43 = call i32 @f2c_cherk(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull @c_b18, ptr noundef %gep, ptr noundef nonnull %3, ptr noundef nonnull @c_b19, ptr noundef %42, ptr noundef nonnull %3) #4
  %44 = call i32 @cpotf2_(ptr noundef nonnull @.str.4, ptr noundef nonnull %8, ptr noundef %42, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  %45 = load i64, ptr %4, align 8, !tbaa !5
  %.not118 = icmp eq i64 %45, 0
  br i1 %.not118, label %46, label %.loopexit120

46:                                               ; preds = %.lr.ph
  %47 = add nuw nsw i64 %.0107126, %28
  %.not116 = icmp sgt i64 %47, %31
  br i1 %.not116, label %.loopexit, label %.lr.ph, !llvm.loop !9

.lr.ph131:                                        ; preds = %34
  %invariant.gep127 = getelementptr i8, ptr %2, i64 -8
  %48 = add i64 %9, 1
  br label %49

49:                                               ; preds = %.lr.ph131, %60
  %.1130 = phi i64 [ 1, %.lr.ph131 ], [ %61, %60 ]
  %50 = load i64, ptr %1, align 8, !tbaa !5
  %reass.sub132 = sub i64 %50, %.1130
  %51 = add i64 %reass.sub132, 1
  %52 = call i64 @llvm.smin.i64(i64 %28, i64 %51)
  store i64 %52, ptr %8, align 8, !tbaa !5
  %53 = add nsw i64 %.1130, -1
  store i64 %53, ptr %7, align 8, !tbaa !5
  %gep128 = getelementptr %struct.complex, ptr %invariant.gep127, i64 %.1130
  %54 = call i32 @f2c_ctrsm(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull @c_b1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %gep128, ptr noundef nonnull %3) #4
  store i64 %53, ptr %7, align 8, !tbaa !5
  %55 = mul i64 %.1130, %48
  %56 = getelementptr inbounds %struct.complex, ptr %11, i64 %55
  %57 = call i32 @f2c_cherk(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull @c_b18, ptr noundef %gep128, ptr noundef nonnull %3, ptr noundef nonnull @c_b19, ptr noundef %56, ptr noundef nonnull %3) #4
  %58 = call i32 @cpotf2_(ptr noundef nonnull @.str.8, ptr noundef nonnull %8, ptr noundef %56, ptr noundef nonnull %3, ptr noundef nonnull %4) #4
  %59 = load i64, ptr %4, align 8, !tbaa !5
  %.not115 = icmp eq i64 %59, 0
  br i1 %.not115, label %60, label %.loopexit120

60:                                               ; preds = %49
  %61 = add nuw nsw i64 %28, %.1130
  %.not137 = icmp sgt i64 %61, %31
  br i1 %.not137, label %.loopexit, label %49, !llvm.loop !11

.loopexit120:                                     ; preds = %.lr.ph, %49
  %.pre-phi = phi i64 [ %53, %49 ], [ %38, %.lr.ph ]
  %62 = phi i64 [ %59, %49 ], [ %45, %.lr.ph ]
  %63 = add i64 %.pre-phi, %62
  store i64 %63, ptr %4, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %46, %60, %.loopexit120, %32, %25, %.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  ret i32 0
}

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

declare i64 @lsame_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i64 @ilaenv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @f2c_ctrsm(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 #2

declare i32 @f2c_cherk(ptr noundef, ptr noundef, 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass