; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/LAPACK (zpteqr)

; 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@c_b1 = external hidden global %struct.doublecomplex, align 8
@c_b2 = external hidden global %struct.doublecomplex, align 8
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@c__0 = external hidden global i64, align 8
@c__1 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @zpteqr_(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 i32, align 4
  %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 ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca [1 x %struct.doublecomplex], align 16
  %22 = alloca i64, align 8
  %23 = alloca [1 x %struct.doublecomplex], align 16
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca i32, align 4
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %2, ptr %12, align 8, !tbaa !5
  store ptr %3, ptr %13, align 8, !tbaa !5
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store ptr %6, ptr %16, align 8, !tbaa !5
  store ptr %7, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = getelementptr inbounds double, ptr %27, i32 -1
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %13, align 8, !tbaa !5
  %30 = getelementptr inbounds double, ptr %29, i32 -1
  store ptr %30, ptr %13, align 8, !tbaa !5
  %31 = load ptr, ptr %15, align 8, !tbaa !5
  %32 = load i64, ptr %31, align 8, !tbaa !9
  store i64 %32, ptr %18, align 8, !tbaa !9
  %33 = load i64, ptr %18, align 8, !tbaa !9
  %34 = add nsw i64 1, %33
  store i64 %34, ptr %19, align 8, !tbaa !9
  %35 = load i64, ptr %19, align 8, !tbaa !9
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = sub i64 0, %35
  %38 = getelementptr inbounds %struct.doublecomplex, ptr %36, i64 %37
  store ptr %38, ptr %14, align 8, !tbaa !5
  %39 = load ptr, ptr %16, align 8, !tbaa !5
  %40 = getelementptr inbounds double, ptr %39, i32 -1
  store ptr %40, ptr %16, align 8, !tbaa !5
  %41 = load ptr, ptr %17, align 8, !tbaa !5
  store i64 0, ptr %41, align 8, !tbaa !9
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = call i64 @lsame_(ptr noundef %42, ptr noundef @.str)
  %44 = icmp ne i64 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %8
  store i64 0, ptr %25, align 8, !tbaa !9
  br label %59

46:                                               ; preds = %8
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = call i64 @lsame_(ptr noundef %47, ptr noundef @.str.1)
  %49 = icmp ne i64 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  store i64 1, ptr %25, align 8, !tbaa !9
  br label %58

51:                                               ; preds = %46
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = call i64 @lsame_(ptr noundef %52, ptr noundef @.str.2)
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  store i64 2, ptr %25, align 8, !tbaa !9
  br label %57

56:                                               ; preds = %51
  store i64 -1, ptr %25, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %56, %55
  br label %58

58:                                               ; preds = %57, %50
  br label %59

59:                                               ; preds = %58, %45
  %60 = load i64, ptr %25, align 8, !tbaa !9
  %61 = icmp slt i64 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  store i64 -1, ptr %63, align 8, !tbaa !9
  br label %94

64:                                               ; preds = %59
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = icmp slt i64 %66, 0
  br i1 %67, label %68, label %70

68:                                               ; preds = %64
  %69 = load ptr, ptr %17, align 8, !tbaa !5
  store i64 -2, ptr %69, align 8, !tbaa !9
  br label %93

70:                                               ; preds = %64
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = icmp slt i64 %72, 1
  br i1 %73, label %90, label %74

74:                                               ; preds = %70
  %75 = load i64, ptr %25, align 8, !tbaa !9
  %76 = icmp sgt i64 %75, 0
  br i1 %76, label %77, label %92

77:                                               ; preds = %74
  %78 = load ptr, ptr %15, align 8, !tbaa !5
  %79 = load i64, ptr %78, align 8, !tbaa !9
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = icmp sge i64 1, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %77
  br label %87

84:                                               ; preds = %77
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = load i64, ptr %85, align 8, !tbaa !9
  br label %87

87:                                               ; preds = %84, %83
  %88 = phi i64 [ 1, %83 ], [ %86, %84 ]
  %89 = icmp slt i64 %79, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %87, %70
  %91 = load ptr, ptr %17, align 8, !tbaa !5
  store i64 -6, ptr %91, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %90, %87, %74
  br label %93

93:                                               ; preds = %92, %68
  br label %94

94:                                               ; preds = %93, %62
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = icmp ne i64 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %94
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = sub nsw i64 0, %100
  store i64 %101, ptr %20, align 8, !tbaa !9
  %102 = call i32 @xerbla_(ptr noundef @.str.3, ptr noundef %20)
  store i32 0, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %245

103:                                              ; preds = %94
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = icmp eq i64 %105, 0
  br i1 %106, label %107, label %108

107:                                              ; preds = %103
  store i32 0, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %245

108:                                              ; preds = %103
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = icmp eq i64 %110, 1
  br i1 %111, label %112, label %127

112:                                              ; preds = %108
  %113 = load i64, ptr %25, align 8, !tbaa !9
  %114 = icmp sgt i64 %113, 0
  br i1 %114, label %115, label %126

115:                                              ; preds = %112
  %116 = load i64, ptr %18, align 8, !tbaa !9
  %117 = add nsw i64 %116, 1
  store i64 %117, ptr %20, align 8, !tbaa !9
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = load i64, ptr %20, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.doublecomplex, ptr %118, i64 %119
  %121 = getelementptr inbounds %struct.doublecomplex, ptr %120, i32 0, i32 0
  store double 1.000000e+00, ptr %121, align 8, !tbaa !11
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = load i64, ptr %20, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct.doublecomplex, ptr %122, i64 %123
  %125 = getelementptr inbounds %struct.doublecomplex, ptr %124, i32 0, i32 1
  store double 0.000000e+00, ptr %125, align 8, !tbaa !14
  br label %126

126:                                              ; preds = %115, %112
  store i32 0, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %245

127:                                              ; preds = %108
  %128 = load i64, ptr %25, align 8, !tbaa !9
  %129 = icmp eq i64 %128, 2
  br i1 %129, label %130, label %138

130:                                              ; preds = %127
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = load i64, ptr %19, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.doublecomplex, ptr %133, i64 %134
  %136 = load ptr, ptr %15, align 8, !tbaa !5
  %137 = call i32 @zlaset_(ptr noundef @.str.4, ptr noundef %131, ptr noundef %132, ptr noundef @c_b1, ptr noundef @c_b2, ptr noundef %135, ptr noundef %136)
  br label %138

138:                                              ; preds = %130, %127
  %139 = load ptr, ptr %11, align 8, !tbaa !5
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  %141 = getelementptr inbounds double, ptr %140, i64 1
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds double, ptr %142, i64 1
  %144 = load ptr, ptr %17, align 8, !tbaa !5
  %145 = call i32 @dpttrf_(ptr noundef %139, ptr noundef %141, ptr noundef %143, ptr noundef %144)
  %146 = load ptr, ptr %17, align 8, !tbaa !5
  %147 = load i64, ptr %146, align 8, !tbaa !9
  %148 = icmp ne i64 %147, 0
  br i1 %148, label %149, label %150

149:                                              ; preds = %138
  store i32 0, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %245

150:                                              ; preds = %138
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = load i64, ptr %151, align 8, !tbaa !9
  store i64 %152, ptr %20, align 8, !tbaa !9
  store i64 1, ptr %22, align 8, !tbaa !9
  br label %153

153:                                              ; preds = %166, %150
  %154 = load i64, ptr %22, align 8, !tbaa !9
  %155 = load i64, ptr %20, align 8, !tbaa !9
  %156 = icmp sle i64 %154, %155
  br i1 %156, label %157, label %169

157:                                              ; preds = %153
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load i64, ptr %22, align 8, !tbaa !9
  %160 = getelementptr inbounds double, ptr %158, i64 %159
  %161 = load double, ptr %160, align 8, !tbaa !15
  %162 = call double @sqrt(double noundef %161) #4
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  %164 = load i64, ptr %22, align 8, !tbaa !9
  %165 = getelementptr inbounds double, ptr %163, i64 %164
  store double %162, ptr %165, align 8, !tbaa !15
  br label %166

166:                                              ; preds = %157
  %167 = load i64, ptr %22, align 8, !tbaa !9
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %22, align 8, !tbaa !9
  br label %153, !llvm.loop !16

169:                                              ; preds = %153
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = load i64, ptr %170, align 8, !tbaa !9
  %172 = sub nsw i64 %171, 1
  store i64 %172, ptr %20, align 8, !tbaa !9
  store i64 1, ptr %22, align 8, !tbaa !9
  br label %173

173:                                              ; preds = %187, %169
  %174 = load i64, ptr %22, align 8, !tbaa !9
  %175 = load i64, ptr %20, align 8, !tbaa !9
  %176 = icmp sle i64 %174, %175
  br i1 %176, label %177, label %190

177:                                              ; preds = %173
  %178 = load ptr, ptr %12, align 8, !tbaa !5
  %179 = load i64, ptr %22, align 8, !tbaa !9
  %180 = getelementptr inbounds double, ptr %178, i64 %179
  %181 = load double, ptr %180, align 8, !tbaa !15
  %182 = load ptr, ptr %13, align 8, !tbaa !5
  %183 = load i64, ptr %22, align 8, !tbaa !9
  %184 = getelementptr inbounds double, ptr %182, i64 %183
  %185 = load double, ptr %184, align 8, !tbaa !15
  %186 = fmul double %185, %181
  store double %186, ptr %184, align 8, !tbaa !15
  br label %187

187:                                              ; preds = %177
  %188 = load i64, ptr %22, align 8, !tbaa !9
  %189 = add nsw i64 %188, 1
  store i64 %189, ptr %22, align 8, !tbaa !9
  br label %173, !llvm.loop !18

190:                                              ; preds = %173
  %191 = load i64, ptr %25, align 8, !tbaa !9
  %192 = icmp sgt i64 %191, 0
  br i1 %192, label %193, label %196

193:                                              ; preds = %190
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = load i64, ptr %194, align 8, !tbaa !9
  store i64 %195, ptr %24, align 8, !tbaa !9
  br label %197

196:                                              ; preds = %190
  store i64 0, ptr %24, align 8, !tbaa !9
  br label %197

197:                                              ; preds = %196, %193
  %198 = load ptr, ptr %11, align 8, !tbaa !5
  %199 = load ptr, ptr %12, align 8, !tbaa !5
  %200 = getelementptr inbounds double, ptr %199, i64 1
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = getelementptr inbounds double, ptr %201, i64 1
  %203 = getelementptr inbounds [1 x %struct.doublecomplex], ptr %23, i64 0, i64 0
  %204 = load ptr, ptr %14, align 8, !tbaa !5
  %205 = load i64, ptr %19, align 8, !tbaa !9
  %206 = getelementptr inbounds %struct.doublecomplex, ptr %204, i64 %205
  %207 = load ptr, ptr %15, align 8, !tbaa !5
  %208 = getelementptr inbounds [1 x %struct.doublecomplex], ptr %21, i64 0, i64 0
  %209 = load ptr, ptr %16, align 8, !tbaa !5
  %210 = getelementptr inbounds double, ptr %209, i64 1
  %211 = load ptr, ptr %17, align 8, !tbaa !5
  %212 = call i32 @zbdsqr_(ptr noundef @.str.5, ptr noundef %198, ptr noundef @c__0, ptr noundef %24, ptr noundef @c__0, ptr noundef %200, ptr noundef %202, ptr noundef %203, ptr noundef @c__1, ptr noundef %206, ptr noundef %207, ptr noundef %208, ptr noundef @c__1, ptr noundef %210, ptr noundef %211)
  %213 = load ptr, ptr %17, align 8, !tbaa !5
  %214 = load i64, ptr %213, align 8, !tbaa !9
  %215 = icmp eq i64 %214, 0
  br i1 %215, label %216, label %237

216:                                              ; preds = %197
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  %218 = load i64, ptr %217, align 8, !tbaa !9
  store i64 %218, ptr %20, align 8, !tbaa !9
  store i64 1, ptr %22, align 8, !tbaa !9
  br label %219

219:                                              ; preds = %233, %216
  %220 = load i64, ptr %22, align 8, !tbaa !9
  %221 = load i64, ptr %20, align 8, !tbaa !9
  %222 = icmp sle i64 %220, %221
  br i1 %222, label %223, label %236

223:                                              ; preds = %219
  %224 = load ptr, ptr %12, align 8, !tbaa !5
  %225 = load i64, ptr %22, align 8, !tbaa !9
  %226 = getelementptr inbounds double, ptr %224, i64 %225
  %227 = load double, ptr %226, align 8, !tbaa !15
  %228 = load ptr, ptr %12, align 8, !tbaa !5
  %229 = load i64, ptr %22, align 8, !tbaa !9
  %230 = getelementptr inbounds double, ptr %228, i64 %229
  %231 = load double, ptr %230, align 8, !tbaa !15
  %232 = fmul double %231, %227
  store double %232, ptr %230, align 8, !tbaa !15
  br label %233

233:                                              ; preds = %223
  %234 = load i64, ptr %22, align 8, !tbaa !9
  %235 = add nsw i64 %234, 1
  store i64 %235, ptr %22, align 8, !tbaa !9
  br label %219, !llvm.loop !19

236:                                              ; preds = %219
  br label %244

237:                                              ; preds = %197
  %238 = load ptr, ptr %11, align 8, !tbaa !5
  %239 = load i64, ptr %238, align 8, !tbaa !9
  %240 = load ptr, ptr %17, align 8, !tbaa !5
  %241 = load i64, ptr %240, align 8, !tbaa !9
  %242 = add nsw i64 %239, %241
  %243 = load ptr, ptr %17, align 8, !tbaa !5
  store i64 %242, ptr %243, align 8, !tbaa !9
  br label %244

244:                                              ; preds = %237, %236
  store i32 0, ptr %9, align 4
  store i32 1, ptr %26, align 4
  br label %245

245:                                              ; preds = %244, %149, %126, %107, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %246 = load i32, ptr %9, align 4
  ret i32 %246
}

; 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 i32 @zlaset_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare i32 @zbdsqr_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, 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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!13, !13, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


; 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@c_b1 = external hidden global %struct.doublecomplex, align 8
@c_b2 = external hidden global %struct.doublecomplex, align 8
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@c__0 = external hidden global i64, align 8
@c__1 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @zpteqr_(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 i64, align 8
  %10 = alloca [1 x %struct.doublecomplex], align 16
  %11 = alloca [1 x %struct.doublecomplex], align 16
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %13 = getelementptr inbounds i8, ptr %2, i64 -8
  %14 = getelementptr inbounds i8, ptr %3, i64 -8
  store i64 0, ptr %7, align 8, !tbaa !5
  %15 = tail call i64 @lsame_(ptr noundef %0, ptr noundef nonnull @.str) #4
  %.not = icmp eq i64 %15, 0
  br i1 %.not, label %16, label %.thread

16:                                               ; preds = %8
  %17 = tail call i64 @lsame_(ptr noundef %0, ptr noundef nonnull @.str.1) #4
  %.not82 = icmp eq i64 %17, 0
  br i1 %.not82, label %18, label %.thread

18:                                               ; preds = %16
  %19 = tail call i64 @lsame_(ptr noundef %0, ptr noundef nonnull @.str.2) #4
  %.not83 = icmp eq i64 %19, 0
  br i1 %.not83, label %.thread94.sink.split, label %.thread

.thread:                                          ; preds = %16, %8, %18
  %20 = phi i1 [ true, %18 ], [ false, %8 ], [ false, %16 ]
  %21 = load i64, ptr %1, align 8, !tbaa !5
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %.thread94.sink.split, label %23

23:                                               ; preds = %.thread
  %24 = load i64, ptr %5, align 8, !tbaa !5
  %25 = icmp slt i64 %24, 1
  %26 = icmp ugt i64 %21, %24
  %or.cond = and i1 %.not, %26
  %or.cond111 = or i1 %25, %or.cond
  br i1 %or.cond111, label %.thread94.sink.split, label %27

27:                                               ; preds = %23
  %.pr = load i64, ptr %7, align 8, !tbaa !5
  %.not84 = icmp eq i64 %.pr, 0
  br i1 %.not84, label %31, label %.thread94

.thread94.sink.split:                             ; preds = %23, %.thread, %18
  %.sink = phi i64 [ -1, %18 ], [ -2, %.thread ], [ -6, %23 ]
  store i64 %.sink, ptr %7, align 8, !tbaa !5
  br label %.thread94

.thread94:                                        ; preds = %.thread94.sink.split, %27
  %28 = phi i64 [ %.pr, %27 ], [ %.sink, %.thread94.sink.split ]
  %29 = sub nsw i64 0, %28
  store i64 %29, ptr %9, align 8, !tbaa !5
  %30 = call i32 @xerbla_(ptr noundef nonnull @.str.3, ptr noundef nonnull %9) #4
  br label %.loopexit

31:                                               ; preds = %27
  switch i64 %21, label %34 [
    i64 0, label %.loopexit
    i64 1, label %32
  ]

32:                                               ; preds = %31
  br i1 %.not, label %33, label %.loopexit

33:                                               ; preds = %32
  store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %4, align 8, !tbaa !9
  br label %.loopexit

34:                                               ; preds = %31
  br i1 %20, label %35, label %37

35:                                               ; preds = %34
  %36 = tail call i32 @zlaset_(ptr noundef nonnull @.str.4, ptr noundef nonnull %1, ptr noundef nonnull %1, ptr noundef nonnull @c_b1, ptr noundef nonnull @c_b2, ptr noundef %4, ptr noundef nonnull %5) #4
  br label %37

37:                                               ; preds = %35, %34
  %38 = tail call i32 @dpttrf_(ptr noundef nonnull %1, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %7) #4
  %39 = load i64, ptr %7, align 8, !tbaa !5
  %.not85 = icmp eq i64 %39, 0
  br i1 %.not85, label %40, label %.loopexit

40:                                               ; preds = %37
  %41 = load i64, ptr %1, align 8, !tbaa !5
  %.not8697 = icmp slt i64 %41, 1
  br i1 %.not8697, label %._crit_edge103, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %40
  %xtraiter = and i64 %41, 3
  %42 = icmp ult i64 %41, 4
  br i1 %42, label %._crit_edge.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %41, 9223372036854775804
  %invariant.gep = getelementptr i8, ptr %13, i64 16
  %invariant.gep136 = getelementptr i8, ptr %13, i64 24
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.07598 = phi i64 [ 1, %.lr.ph.preheader.new ], [ %53, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %43 = getelementptr inbounds double, ptr %13, i64 %.07598
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = tail call double @sqrt(double noundef %44) #4
  store double %45, ptr %43, align 8, !tbaa !9
  %46 = getelementptr double, ptr %2, i64 %.07598
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = tail call double @sqrt(double noundef %47) #4
  store double %48, ptr %46, align 8, !tbaa !9
  %gep = getelementptr double, ptr %invariant.gep, i64 %.07598
  %49 = load double, ptr %gep, align 8, !tbaa !9
  %50 = tail call double @sqrt(double noundef %49) #4
  store double %50, ptr %gep, align 8, !tbaa !9
  %gep137 = getelementptr double, ptr %invariant.gep136, i64 %.07598
  %51 = load double, ptr %gep137, align 8, !tbaa !9
  %52 = tail call double @sqrt(double noundef %51) #4
  store double %52, ptr %gep137, align 8, !tbaa !9
  %53 = add nuw i64 %.07598, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.unr-lcssa, label %.lr.ph, !llvm.loop !11

._crit_edge.unr-lcssa:                            ; preds = %.lr.ph, %.lr.ph.preheader
  %.07598.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %53, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.unr-lcssa, %.lr.ph.epil
  %.07598.epil = phi i64 [ %57, %.lr.ph.epil ], [ %.07598.unr, %._crit_edge.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.unr-lcssa ]
  %54 = getelementptr inbounds double, ptr %13, i64 %.07598.epil
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = tail call double @sqrt(double noundef %55) #4
  store double %56, ptr %54, align 8, !tbaa !9
  %57 = add nuw i64 %.07598.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph.epil, %._crit_edge.unr-lcssa
  %.pre = load i64, ptr %1, align 8, !tbaa !5
  %.not87.not99 = icmp sgt i64 %.pre, 1
  br i1 %.not87.not99, label %.lr.ph102.preheader, label %._crit_edge103

.lr.ph102.preheader:                              ; preds = %._crit_edge
  %58 = add nsw i64 %.pre, -1
  %min.iters.check = icmp ult i64 %.pre, 9
  br i1 %min.iters.check, label %.lr.ph102.preheader132, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph102.preheader
  %59 = shl i64 %.pre, 3
  %60 = add i64 %59, -8
  %scevgep = getelementptr i8, ptr %3, i64 %60
  %scevgep112 = getelementptr i8, ptr %2, i64 %60
  %bound0 = icmp ugt ptr %scevgep112, %3
  %bound1 = icmp ugt ptr %scevgep, %2
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph102.preheader132, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %58, -4
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %61 = getelementptr double, ptr %2, i64 %index
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %wide.load = load <2 x double>, ptr %61, align 8, !tbaa !9, !alias.scope !15
  %wide.load113 = load <2 x double>, ptr %62, align 8, !tbaa !9, !alias.scope !15
  %63 = getelementptr double, ptr %3, i64 %index
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load114 = load <2 x double>, ptr %63, align 8, !tbaa !9, !alias.scope !18, !noalias !15
  %wide.load115 = load <2 x double>, ptr %64, align 8, !tbaa !9, !alias.scope !18, !noalias !15
  %65 = fmul <2 x double> %wide.load, %wide.load114
  %66 = fmul <2 x double> %wide.load113, %wide.load115
  store <2 x double> %65, ptr %63, align 8, !tbaa !9, !alias.scope !18, !noalias !15
  store <2 x double> %66, ptr %64, align 8, !tbaa !9, !alias.scope !18, !noalias !15
  %index.next = add nuw i64 %index, 4
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %58, %n.vec
  br i1 %cmp.n, label %._crit_edge103, label %.lr.ph102.preheader132

.lr.ph102.preheader132:                           ; preds = %middle.block, %vector.memcheck, %.lr.ph102.preheader
  %.1100.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %.lr.ph102.preheader ], [ %ind.end, %middle.block ]
  %68 = sub i64 %.pre, %.1100.ph
  %xtraiter133 = and i64 %68, 3
  %lcmp.mod134.not = icmp eq i64 %xtraiter133, 0
  br i1 %lcmp.mod134.not, label %.lr.ph102.prol.loopexit, label %.lr.ph102.prol

.lr.ph102.prol:                                   ; preds = %.lr.ph102.preheader132, %.lr.ph102.prol
  %.1100.prol = phi i64 [ %74, %.lr.ph102.prol ], [ %.1100.ph, %.lr.ph102.preheader132 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph102.prol ], [ 0, %.lr.ph102.preheader132 ]
  %69 = getelementptr inbounds double, ptr %13, i64 %.1100.prol
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds double, ptr %14, i64 %.1100.prol
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = fmul double %70, %72
  store double %73, ptr %71, align 8, !tbaa !9
  %74 = add nuw nsw i64 %.1100.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter133
  br i1 %prol.iter.cmp.not, label %.lr.ph102.prol.loopexit, label %.lr.ph102.prol, !llvm.loop !23

.lr.ph102.prol.loopexit:                          ; preds = %.lr.ph102.prol, %.lr.ph102.preheader132
  %.1100.unr = phi i64 [ %.1100.ph, %.lr.ph102.preheader132 ], [ %74, %.lr.ph102.prol ]
  %75 = sub i64 %.1100.ph, %.pre
  %76 = icmp ugt i64 %75, -4
  br i1 %76, label %._crit_edge103, label %.lr.ph102

.lr.ph102:                                        ; preds = %.lr.ph102.prol.loopexit, %.lr.ph102
  %.1100 = phi i64 [ %99, %.lr.ph102 ], [ %.1100.unr, %.lr.ph102.prol.loopexit ]
  %77 = getelementptr inbounds double, ptr %13, i64 %.1100
  %78 = load double, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds double, ptr %14, i64 %.1100
  %80 = load double, ptr %79, align 8, !tbaa !9
  %81 = fmul double %78, %80
  store double %81, ptr %79, align 8, !tbaa !9
  %82 = getelementptr double, ptr %2, i64 %.1100
  %83 = load double, ptr %82, align 8, !tbaa !9
  %84 = getelementptr double, ptr %3, i64 %.1100
  %85 = load double, ptr %84, align 8, !tbaa !9
  %86 = fmul double %83, %85
  store double %86, ptr %84, align 8, !tbaa !9
  %87 = add nuw nsw i64 %.1100, 2
  %88 = getelementptr inbounds double, ptr %13, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds double, ptr %14, i64 %87
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = fmul double %89, %91
  store double %92, ptr %90, align 8, !tbaa !9
  %93 = add nuw nsw i64 %.1100, 3
  %94 = getelementptr inbounds double, ptr %13, i64 %93
  %95 = load double, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds double, ptr %14, i64 %93
  %97 = load double, ptr %96, align 8, !tbaa !9
  %98 = fmul double %95, %97
  store double %98, ptr %96, align 8, !tbaa !9
  %99 = add nuw nsw i64 %.1100, 4
  %exitcond108.not.3 = icmp eq i64 %99, %.pre
  br i1 %exitcond108.not.3, label %._crit_edge103, label %.lr.ph102, !llvm.loop !24

._crit_edge103:                                   ; preds = %.lr.ph102.prol.loopexit, %.lr.ph102, %middle.block, %40, %._crit_edge
  %100 = phi i64 [ %.pre, %._crit_edge ], [ %41, %40 ], [ %.pre, %middle.block ], [ %.pre, %.lr.ph102 ], [ %.pre, %.lr.ph102.prol.loopexit ]
  %spec.select96 = select i1 %.not, i64 %100, i64 0
  store i64 %spec.select96, ptr %12, align 8, !tbaa !5
  %101 = call i32 @zbdsqr_(ptr noundef nonnull @.str.5, ptr noundef nonnull %1, ptr noundef nonnull @c__0, ptr noundef nonnull %12, ptr noundef nonnull @c__0, ptr noundef %2, ptr noundef %3, ptr noundef nonnull %11, ptr noundef nonnull @c__1, ptr noundef %4, ptr noundef nonnull %5, ptr noundef nonnull %10, ptr noundef nonnull @c__1, ptr noundef %6, ptr noundef nonnull %7) #4
  %102 = load i64, ptr %7, align 8, !tbaa !5
  %103 = icmp eq i64 %102, 0
  %104 = load i64, ptr %1, align 8, !tbaa !5
  br i1 %103, label %105, label %115

105:                                              ; preds = %._crit_edge103
  %.not88104 = icmp slt i64 %104, 1
  br i1 %.not88104, label %.loopexit, label %.lr.ph107.preheader

.lr.ph107.preheader:                              ; preds = %105
  %min.iters.check118 = icmp ult i64 %104, 4
  br i1 %min.iters.check118, label %.lr.ph107.preheader131, label %vector.ph119

vector.ph119:                                     ; preds = %.lr.ph107.preheader
  %n.vec121 = and i64 %104, 9223372036854775804
  %ind.end122 = or disjoint i64 %n.vec121, 1
  br label %vector.body124

vector.body124:                                   ; preds = %vector.body124, %vector.ph119
  %index125 = phi i64 [ 0, %vector.ph119 ], [ %index.next129, %vector.body124 ]
  %106 = getelementptr double, ptr %2, i64 %index125
  %107 = getelementptr inbounds i8, ptr %106, i64 16
  %wide.load127 = load <2 x double>, ptr %106, align 8, !tbaa !9
  %wide.load128 = load <2 x double>, ptr %107, align 8, !tbaa !9
  %108 = fmul <2 x double> %wide.load127, %wide.load127
  %109 = fmul <2 x double> %wide.load128, %wide.load128
  store <2 x double> %108, ptr %106, align 8, !tbaa !9
  store <2 x double> %109, ptr %107, align 8, !tbaa !9
  %index.next129 = add nuw i64 %index125, 4
  %110 = icmp eq i64 %index.next129, %n.vec121
  br i1 %110, label %middle.block116, label %vector.body124, !llvm.loop !25

middle.block116:                                  ; preds = %vector.body124
  %cmp.n130 = icmp eq i64 %104, %n.vec121
  br i1 %cmp.n130, label %.loopexit, label %.lr.ph107.preheader131

.lr.ph107.preheader131:                           ; preds = %middle.block116, %.lr.ph107.preheader
  %.2105.ph = phi i64 [ 1, %.lr.ph107.preheader ], [ %ind.end122, %middle.block116 ]
  br label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph107.preheader131, %.lr.ph107
  %.2105 = phi i64 [ %114, %.lr.ph107 ], [ %.2105.ph, %.lr.ph107.preheader131 ]
  %111 = getelementptr inbounds double, ptr %13, i64 %.2105
  %112 = load double, ptr %111, align 8, !tbaa !9
  %113 = fmul double %112, %112
  store double %113, ptr %111, align 8, !tbaa !9
  %114 = add nuw i64 %.2105, 1
  %exitcond109.not = icmp eq i64 %.2105, %104
  br i1 %exitcond109.not, label %.loopexit, label %.lr.ph107, !llvm.loop !26

115:                                              ; preds = %._crit_edge103
  %116 = add nsw i64 %104, %102
  store i64 %116, ptr %7, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph107, %middle.block116, %105, %115, %37, %32, %33, %31, %.thread94
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #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 i32 @zlaset_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare i32 @zbdsqr_(ptr noundef, ptr noundef, ptr noundef, 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 #2

; Function Attrs: mustprogress 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 = { 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 = { 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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !12, !21}
!25 = distinct !{!25, !12, !21, !22}
!26 = distinct !{!26, !12, !22, !21}


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