; LLVM IR from OpenMathLib/OpenBLAS :: lapack-netlib/SRC (zpotrf2)

; 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.doublecomplex = type { double, double }

@.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 [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@c_b1 = external hidden global %struct.doublecomplex, align 8
@c_b11 = external hidden global double, align 8
@c_b12 = external hidden global double, align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

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

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

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

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

54:                                               ; preds = %48
  br label %58

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

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

61:                                               ; preds = %58
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 -4, ptr %62, align 4, !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 %10, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %74

69:                                               ; preds = %65
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = sub nsw i32 0, %71
  store i32 %72, ptr %13, align 4, !tbaa !9
  %73 = call i32 @xerbla_(ptr noundef @.str.2, ptr noundef %13, i32 noundef 7)
  store i32 1, ptr %20, align 4
  br label %252

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

78:                                               ; preds = %74
  store i32 1, ptr %20, align 4
  br label %252

79:                                               ; preds = %74
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %83, label %115

83:                                               ; preds = %79
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %13, align 4, !tbaa !9
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds %struct.doublecomplex, ptr %86, i64 %88
  %90 = getelementptr inbounds %struct.doublecomplex, ptr %89, i32 0, i32 0
  %91 = load double, ptr %90, align 8, !tbaa !11
  store double %91, ptr %19, align 8, !tbaa !14
  %92 = load double, ptr %19, align 8, !tbaa !14
  %93 = fcmp ole double %92, 0.000000e+00
  br i1 %93, label %97, label %94

94:                                               ; preds = %83
  %95 = call i32 @disnan_(ptr noundef %19)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %99

97:                                               ; preds = %94, %83
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 1, ptr %98, align 4, !tbaa !9
  store i32 1, ptr %20, align 4
  br label %252

99:                                               ; preds = %94
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %13, align 4, !tbaa !9
  %102 = load double, ptr %19, align 8, !tbaa !14
  %103 = call double @sqrt(double noundef %102) #4
  store double %103, ptr %14, align 8, !tbaa !14
  %104 = load double, ptr %14, align 8, !tbaa !14
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.doublecomplex, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.doublecomplex, ptr %108, i32 0, i32 0
  store double %104, ptr %109, align 8, !tbaa !11
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.doublecomplex, ptr %110, i64 %112
  %114 = getelementptr inbounds %struct.doublecomplex, ptr %113, i32 0, i32 1
  store double 0.000000e+00, ptr %114, align 8, !tbaa !15
  br label %251

115:                                              ; preds = %79
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = sdiv i32 %117, 2
  store i32 %118, ptr %17, align 4, !tbaa !9
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = load i32, ptr %17, align 4, !tbaa !9
  %122 = sub nsw i32 %120, %121
  store i32 %122, ptr %18, align 4, !tbaa !9
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = add nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.doublecomplex, ptr %124, i64 %127
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  call void @zpotrf2_(ptr noundef %123, ptr noundef %17, ptr noundef %128, ptr noundef %129, ptr noundef %15)
  %130 = load i32, ptr %15, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %135

132:                                              ; preds = %115
  %133 = load i32, ptr %15, align 4, !tbaa !9
  %134 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %133, ptr %134, align 4, !tbaa !9
  store i32 1, ptr %20, align 4
  br label %252

135:                                              ; preds = %115
  %136 = load i32, ptr %16, align 4, !tbaa !9
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %195

138:                                              ; preds = %135
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = add nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds %struct.doublecomplex, ptr %139, i64 %142
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = add nsw i32 %146, 1
  %148 = load i32, ptr %11, align 4, !tbaa !9
  %149 = mul nsw i32 %147, %148
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.doublecomplex, ptr %145, i64 %151
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ztrsm_(ptr noundef @.str.1, ptr noundef @.str, ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef %17, ptr noundef %18, ptr noundef @c_b1, ptr noundef %143, ptr noundef %144, ptr noundef %152, ptr noundef %153)
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = load i32, ptr %17, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  %158 = load i32, ptr %11, align 4, !tbaa !9
  %159 = mul nsw i32 %157, %158
  %160 = add nsw i32 %159, 1
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds %struct.doublecomplex, ptr %155, i64 %161
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = load i32, ptr %17, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  %169 = load i32, ptr %11, align 4, !tbaa !9
  %170 = mul nsw i32 %168, %169
  %171 = add nsw i32 %166, %170
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds %struct.doublecomplex, ptr %164, i64 %172
  %174 = load ptr, ptr %9, align 8, !tbaa !5
  call void @zherk_(ptr noundef %154, ptr noundef @.str.3, ptr noundef %18, ptr noundef %17, ptr noundef @c_b11, ptr noundef %162, ptr noundef %163, ptr noundef @c_b12, ptr noundef %173, ptr noundef %174)
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = load i32, ptr %17, align 4, !tbaa !9
  %178 = add nsw i32 %177, 1
  %179 = load i32, ptr %17, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  %181 = load i32, ptr %11, align 4, !tbaa !9
  %182 = mul nsw i32 %180, %181
  %183 = add nsw i32 %178, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct.doublecomplex, ptr %176, i64 %184
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  call void @zpotrf2_(ptr noundef %175, ptr noundef %18, ptr noundef %185, ptr noundef %186, ptr noundef %15)
  %187 = load i32, ptr %15, align 4, !tbaa !9
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %194

189:                                              ; preds = %138
  %190 = load i32, ptr %15, align 4, !tbaa !9
  %191 = load i32, ptr %17, align 4, !tbaa !9
  %192 = add nsw i32 %190, %191
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %192, ptr %193, align 4, !tbaa !9
  store i32 1, ptr %20, align 4
  br label %252

194:                                              ; preds = %138
  br label %250

195:                                              ; preds = %135
  %196 = load ptr, ptr %8, align 8, !tbaa !5
  %197 = load i32, ptr %11, align 4, !tbaa !9
  %198 = add nsw i32 %197, 1
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds %struct.doublecomplex, ptr %196, i64 %199
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = load ptr, ptr %8, align 8, !tbaa !5
  %203 = load i32, ptr %17, align 4, !tbaa !9
  %204 = add nsw i32 %203, 1
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = add nsw i32 %204, %205
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds %struct.doublecomplex, ptr %202, i64 %207
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ztrsm_(ptr noundef @.str.5, ptr noundef @.str.1, ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef %18, ptr noundef %17, ptr noundef @c_b1, ptr noundef %200, ptr noundef %201, ptr noundef %208, ptr noundef %209)
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = load ptr, ptr %8, align 8, !tbaa !5
  %212 = load i32, ptr %17, align 4, !tbaa !9
  %213 = add nsw i32 %212, 1
  %214 = load i32, ptr %11, align 4, !tbaa !9
  %215 = add nsw i32 %213, %214
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds %struct.doublecomplex, ptr %211, i64 %216
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = load ptr, ptr %8, align 8, !tbaa !5
  %220 = load i32, ptr %17, align 4, !tbaa !9
  %221 = add nsw i32 %220, 1
  %222 = load i32, ptr %17, align 4, !tbaa !9
  %223 = add nsw i32 %222, 1
  %224 = load i32, ptr %11, align 4, !tbaa !9
  %225 = mul nsw i32 %223, %224
  %226 = add nsw i32 %221, %225
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %struct.doublecomplex, ptr %219, i64 %227
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  call void @zherk_(ptr noundef %210, ptr noundef @.str.4, ptr noundef %18, ptr noundef %17, ptr noundef @c_b11, ptr noundef %217, ptr noundef %218, ptr noundef @c_b12, ptr noundef %228, ptr noundef %229)
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = load ptr, ptr %8, align 8, !tbaa !5
  %232 = load i32, ptr %17, align 4, !tbaa !9
  %233 = add nsw i32 %232, 1
  %234 = load i32, ptr %17, align 4, !tbaa !9
  %235 = add nsw i32 %234, 1
  %236 = load i32, ptr %11, align 4, !tbaa !9
  %237 = mul nsw i32 %235, %236
  %238 = add nsw i32 %233, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds %struct.doublecomplex, ptr %231, i64 %239
  %241 = load ptr, ptr %9, align 8, !tbaa !5
  call void @zpotrf2_(ptr noundef %230, ptr noundef %18, ptr noundef %240, ptr noundef %241, ptr noundef %15)
  %242 = load i32, ptr %15, align 4, !tbaa !9
  %243 = icmp ne i32 %242, 0
  br i1 %243, label %244, label %249

244:                                              ; preds = %195
  %245 = load i32, ptr %15, align 4, !tbaa !9
  %246 = load i32, ptr %17, align 4, !tbaa !9
  %247 = add nsw i32 %245, %246
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  store i32 %247, ptr %248, align 4, !tbaa !9
  store i32 1, ptr %20, align 4
  br label %252

249:                                              ; preds = %195
  br label %250

250:                                              ; preds = %249, %194
  br label %251

251:                                              ; preds = %250, %99
  store i32 1, ptr %20, align 4
  br label %252

252:                                              ; preds = %251, %244, %189, %132, %97, %78, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  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 @lsame_(ptr noundef, ptr noundef) #2

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

declare i32 @disnan_(ptr noundef) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

declare void @zherk_(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 "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 }

!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, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !13, i64 8}


; 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.doublecomplex = type { double, double }

@.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 [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@c_b1 = external hidden global %struct.doublecomplex, align 8
@c_b11 = external hidden global double, align 8
@c_b12 = external hidden global double, align 8
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

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

16:                                               ; preds = %5
  %17 = tail call i32 @lsame_(ptr noundef %0, ptr noundef nonnull @.str.1) #5
  %.not74 = icmp eq i32 %17, 0
  br i1 %.not74, label %.thread.sink.split, label %18

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

21:                                               ; preds = %18
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %spec.select = tail call i32 @llvm.umax.i32(i32 %19, i32 1)
  %23 = icmp slt i32 %22, %spec.select
  br i1 %23, label %.thread.sink.split, label %24

24:                                               ; preds = %21
  %.pr = load i32, ptr %4, align 4, !tbaa !5
  %.not75 = icmp eq i32 %.pr, 0
  br i1 %.not75, label %28, label %.thread

.thread.sink.split:                               ; preds = %21, %18, %16
  %.sink = phi i32 [ -1, %16 ], [ -2, %18 ], [ -4, %21 ]
  store i32 %.sink, ptr %4, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %24
  %25 = phi i32 [ %.pr, %24 ], [ %.sink, %.thread.sink.split ]
  %26 = sub nsw i32 0, %25
  store i32 %26, ptr %6, align 4, !tbaa !5
  %27 = call i32 @xerbla_(ptr noundef nonnull @.str.2, ptr noundef nonnull %6, i32 noundef 7) #5
  br label %92

28:                                               ; preds = %24
  switch i32 %19, label %41 [
    i32 0, label %92
    i32 1, label %29
  ]

29:                                               ; preds = %28
  %30 = load double, ptr %2, align 8, !tbaa !9
  store double %30, ptr %10, align 8, !tbaa !12
  %31 = fcmp ugt double %30, 0.000000e+00
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = call i32 @disnan_(ptr noundef nonnull %10) #5
  %.not79 = icmp eq i32 %33, 0
  br i1 %.not79, label %35, label %34

34:                                               ; preds = %32, %29
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %92

35:                                               ; preds = %32
  %36 = load double, ptr %10, align 8, !tbaa !12
  %37 = call double @sqrt(double noundef %36) #5
  %38 = sext i32 %12 to i64
  %39 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %38
  store double %37, ptr %39, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %38, i32 1
  store double 0.000000e+00, ptr %40, align 8, !tbaa !13
  br label %92

41:                                               ; preds = %28
  %42 = lshr i32 %19, 1
  store i32 %42, ptr %8, align 4, !tbaa !5
  %43 = sub nsw i32 %19, %42
  store i32 %43, ptr %9, align 4, !tbaa !5
  call void @zpotrf2_(ptr noundef %0, ptr noundef nonnull %8, ptr noundef %2, ptr noundef nonnull %3, ptr noundef nonnull %7)
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %.not76 = icmp eq i32 %44, 0
  br i1 %.not76, label %46, label %45

45:                                               ; preds = %41
  store i32 %44, ptr %4, align 4, !tbaa !5
  br label %92

46:                                               ; preds = %41
  br i1 %.not, label %71, label %47

47:                                               ; preds = %46
  %48 = add nuw nsw i32 %42, 1
  %49 = mul nsw i32 %48, %11
  %50 = sext i32 %49 to i64
  %51 = getelementptr %struct.doublecomplex, ptr %14, i64 %50
  %52 = getelementptr i8, ptr %51, i64 16
  call void @ztrsm_(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull @c_b1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %52, ptr noundef nonnull %3) #5
  %53 = load i32, ptr %8, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = mul nsw i32 %54, %11
  %56 = sext i32 %55 to i64
  %57 = getelementptr %struct.doublecomplex, ptr %14, i64 %56
  %58 = getelementptr i8, ptr %57, i64 16
  %59 = add nsw i32 %55, %54
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %60
  call void @zherk_(ptr noundef %0, ptr noundef nonnull @.str.3, ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull @c_b11, ptr noundef %58, ptr noundef nonnull %3, ptr noundef nonnull @c_b12, ptr noundef %61, ptr noundef nonnull %3) #5
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  %64 = mul i32 %63, %12
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %65
  call void @zpotrf2_(ptr noundef %0, ptr noundef nonnull %9, ptr noundef %66, ptr noundef nonnull %3, ptr noundef nonnull %7)
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %.not78 = icmp eq i32 %67, 0
  br i1 %.not78, label %92, label %68

68:                                               ; preds = %47
  %69 = load i32, ptr %8, align 4, !tbaa !5
  %70 = add nsw i32 %69, %67
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %92

71:                                               ; preds = %46
  %72 = add i32 %12, %42
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %73
  call void @ztrsm_(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull @c_b1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %74, ptr noundef nonnull %3) #5
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  %77 = add nsw i32 %76, %11
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %78
  %80 = mul i32 %76, %12
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %81
  call void @zherk_(ptr noundef %0, ptr noundef nonnull @.str.4, ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull @c_b11, ptr noundef %79, ptr noundef nonnull %3, ptr noundef nonnull @c_b12, ptr noundef %82, ptr noundef nonnull %3) #5
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = mul i32 %84, %12
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %struct.doublecomplex, ptr %14, i64 %86
  call void @zpotrf2_(ptr noundef %0, ptr noundef nonnull %9, ptr noundef %87, ptr noundef nonnull %3, ptr noundef nonnull %7)
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %.not77 = icmp eq i32 %88, 0
  br i1 %.not77, label %92, label %89

89:                                               ; preds = %71
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = add nsw i32 %90, %88
  store i32 %91, ptr %4, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %35, %71, %47, %28, %89, %68, %45, %34, %.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  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 @lsame_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @disnan_(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

declare void @ztrsm_(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 void @zherk_(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 i32 @llvm.umax.i32(i32, i32) #4

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 nofree nounwind willreturn memory(write) "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8}
!11 = !{!"double", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass