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

; 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@c__1 = external hidden global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @chpgv_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) #0 {
  %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 ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca [1 x i8], align 1
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store ptr %0, ptr %13, align 8, !tbaa !5
  store ptr %1, ptr %14, align 8, !tbaa !5
  store ptr %2, ptr %15, align 8, !tbaa !5
  store ptr %3, ptr %16, align 8, !tbaa !5
  store ptr %4, ptr %17, align 8, !tbaa !5
  store ptr %5, ptr %18, align 8, !tbaa !5
  store ptr %6, ptr %19, align 8, !tbaa !5
  store ptr %7, ptr %20, align 8, !tbaa !5
  store ptr %8, ptr %21, align 8, !tbaa !5
  store ptr %9, ptr %22, align 8, !tbaa !5
  store ptr %10, ptr %23, align 8, !tbaa !5
  store ptr %11, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  %34 = load ptr, ptr %17, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.complex, ptr %34, i32 -1
  store ptr %35, ptr %17, align 8, !tbaa !5
  %36 = load ptr, ptr %18, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.complex, ptr %36, i32 -1
  store ptr %37, ptr %18, align 8, !tbaa !5
  %38 = load ptr, ptr %19, align 8, !tbaa !5
  %39 = getelementptr inbounds float, ptr %38, i32 -1
  store ptr %39, ptr %19, align 8, !tbaa !5
  %40 = load ptr, ptr %21, align 8, !tbaa !5
  %41 = load i32, ptr %40, align 4, !tbaa !9
  store i32 %41, ptr %25, align 4, !tbaa !9
  %42 = load i32, ptr %25, align 4, !tbaa !9
  %43 = mul nsw i32 %42, 1
  %44 = add nsw i32 1, %43
  store i32 %44, ptr %26, align 4, !tbaa !9
  %45 = load i32, ptr %26, align 4, !tbaa !9
  %46 = load ptr, ptr %20, align 8, !tbaa !5
  %47 = sext i32 %45 to i64
  %48 = sub i64 0, %47
  %49 = getelementptr inbounds %struct.complex, ptr %46, i64 %48
  store ptr %49, ptr %20, align 8, !tbaa !5
  %50 = load ptr, ptr %22, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.complex, ptr %50, i32 -1
  store ptr %51, ptr %22, align 8, !tbaa !5
  %52 = load ptr, ptr %23, align 8, !tbaa !5
  %53 = getelementptr inbounds float, ptr %52, i32 -1
  store ptr %53, ptr %23, align 8, !tbaa !5
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = call i32 @lsame_(ptr noundef %54, ptr noundef @.str)
  store i32 %55, ptr %32, align 4, !tbaa !9
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = call i32 @lsame_(ptr noundef %56, ptr noundef @.str.1)
  store i32 %57, ptr %31, align 4, !tbaa !9
  %58 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 0, ptr %58, align 4, !tbaa !9
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %66, label %62

62:                                               ; preds = %12
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = icmp sgt i32 %64, 3
  br i1 %65, label %66, label %68

66:                                               ; preds = %62, %12
  %67 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 -1, ptr %67, align 4, !tbaa !9
  br label %111

68:                                               ; preds = %62
  %69 = load i32, ptr %32, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %77, label %71

71:                                               ; preds = %68
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = call i32 @lsame_(ptr noundef %72, ptr noundef @.str.2)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %77, label %75

75:                                               ; preds = %71
  %76 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 -2, ptr %76, align 4, !tbaa !9
  br label %110

77:                                               ; preds = %71, %68
  %78 = load i32, ptr %31, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %86, label %80

80:                                               ; preds = %77
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = call i32 @lsame_(ptr noundef %81, ptr noundef @.str.3)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %86, label %84

84:                                               ; preds = %80
  %85 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 -3, ptr %85, align 4, !tbaa !9
  br label %109

86:                                               ; preds = %80, %77
  %87 = load ptr, ptr %16, align 8, !tbaa !5
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = icmp slt i32 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %86
  %91 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 -4, ptr %91, align 4, !tbaa !9
  br label %108

92:                                               ; preds = %86
  %93 = load ptr, ptr %21, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp slt i32 %94, 1
  br i1 %95, label %105, label %96

96:                                               ; preds = %92
  %97 = load i32, ptr %32, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %107

99:                                               ; preds = %96
  %100 = load ptr, ptr %21, align 8, !tbaa !5
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = load ptr, ptr %16, align 8, !tbaa !5
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = icmp slt i32 %101, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %99, %92
  %106 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 -9, ptr %106, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %105, %99, %96
  br label %108

108:                                              ; preds = %107, %90
  br label %109

109:                                              ; preds = %108, %84
  br label %110

110:                                              ; preds = %109, %75
  br label %111

111:                                              ; preds = %110, %66
  %112 = load ptr, ptr %24, align 8, !tbaa !5
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %111
  %116 = load ptr, ptr %24, align 8, !tbaa !5
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = sub nsw i32 0, %117
  store i32 %118, ptr %27, align 4, !tbaa !9
  %119 = call i32 @xerbla_(ptr noundef @.str.4, ptr noundef %27, i32 noundef 6)
  store i32 1, ptr %33, align 4
  br label %254

120:                                              ; preds = %111
  %121 = load ptr, ptr %16, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %125

124:                                              ; preds = %120
  store i32 1, ptr %33, align 4
  br label %254

125:                                              ; preds = %120
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = load ptr, ptr %18, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.complex, ptr %128, i64 1
  %130 = load ptr, ptr %24, align 8, !tbaa !5
  call void @cpptrf_(ptr noundef %126, ptr noundef %127, ptr noundef %129, ptr noundef %130)
  %131 = load ptr, ptr %24, align 8, !tbaa !5
  %132 = load i32, ptr %131, align 4, !tbaa !9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %141

134:                                              ; preds = %125
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = load ptr, ptr %24, align 8, !tbaa !5
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = add nsw i32 %136, %138
  %140 = load ptr, ptr %24, align 8, !tbaa !5
  store i32 %139, ptr %140, align 4, !tbaa !9
  store i32 1, ptr %33, align 4
  br label %254

141:                                              ; preds = %125
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.complex, ptr %145, i64 1
  %147 = load ptr, ptr %18, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.complex, ptr %147, i64 1
  %149 = load ptr, ptr %24, align 8, !tbaa !5
  call void @chpgst_(ptr noundef %142, ptr noundef %143, ptr noundef %144, ptr noundef %146, ptr noundef %148, ptr noundef %149)
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = load ptr, ptr %15, align 8, !tbaa !5
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.complex, ptr %153, i64 1
  %155 = load ptr, ptr %19, align 8, !tbaa !5
  %156 = getelementptr inbounds float, ptr %155, i64 1
  %157 = load ptr, ptr %20, align 8, !tbaa !5
  %158 = load i32, ptr %26, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds %struct.complex, ptr %157, i64 %159
  %161 = load ptr, ptr %21, align 8, !tbaa !5
  %162 = load ptr, ptr %22, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.complex, ptr %162, i64 1
  %164 = load ptr, ptr %23, align 8, !tbaa !5
  %165 = getelementptr inbounds float, ptr %164, i64 1
  %166 = load ptr, ptr %24, align 8, !tbaa !5
  call void @chpev_(ptr noundef %150, ptr noundef %151, ptr noundef %152, ptr noundef %154, ptr noundef %156, ptr noundef %160, ptr noundef %161, ptr noundef %163, ptr noundef %165, ptr noundef %166)
  %167 = load i32, ptr %32, align 4, !tbaa !9
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %253

169:                                              ; preds = %141
  %170 = load ptr, ptr %16, align 8, !tbaa !5
  %171 = load i32, ptr %170, align 4, !tbaa !9
  store i32 %171, ptr %28, align 4, !tbaa !9
  %172 = load ptr, ptr %24, align 8, !tbaa !5
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = icmp sgt i32 %173, 0
  br i1 %174, label %175, label %179

175:                                              ; preds = %169
  %176 = load ptr, ptr %24, align 8, !tbaa !5
  %177 = load i32, ptr %176, align 4, !tbaa !9
  %178 = sub nsw i32 %177, 1
  store i32 %178, ptr %28, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %175, %169
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = load i32, ptr %180, align 4, !tbaa !9
  %182 = icmp eq i32 %181, 1
  br i1 %182, label %187, label %183

183:                                              ; preds = %179
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = load i32, ptr %184, align 4, !tbaa !9
  %186 = icmp eq i32 %185, 2
  br i1 %186, label %187, label %217

187:                                              ; preds = %183, %179
  %188 = load i32, ptr %31, align 4, !tbaa !9
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %192

190:                                              ; preds = %187
  %191 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  store i8 78, ptr %191, align 1, !tbaa !11
  br label %194

192:                                              ; preds = %187
  %193 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  store i8 67, ptr %193, align 1, !tbaa !11
  br label %194

194:                                              ; preds = %192, %190
  %195 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %195, ptr %27, align 4, !tbaa !9
  store i32 1, ptr %29, align 4, !tbaa !9
  br label %196

196:                                              ; preds = %213, %194
  %197 = load i32, ptr %29, align 4, !tbaa !9
  %198 = load i32, ptr %27, align 4, !tbaa !9
  %199 = icmp sle i32 %197, %198
  br i1 %199, label %200, label %216

200:                                              ; preds = %196
  %201 = load ptr, ptr %15, align 8, !tbaa !5
  %202 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  %203 = load ptr, ptr %16, align 8, !tbaa !5
  %204 = load ptr, ptr %18, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.complex, ptr %204, i64 1
  %206 = load ptr, ptr %20, align 8, !tbaa !5
  %207 = load i32, ptr %29, align 4, !tbaa !9
  %208 = load i32, ptr %25, align 4, !tbaa !9
  %209 = mul nsw i32 %207, %208
  %210 = add nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds %struct.complex, ptr %206, i64 %211
  call void @ctpsv_(ptr noundef %201, ptr noundef %202, ptr noundef @.str.5, ptr noundef %203, ptr noundef %205, ptr noundef %212, ptr noundef @c__1)
  br label %213

213:                                              ; preds = %200
  %214 = load i32, ptr %29, align 4, !tbaa !9
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %29, align 4, !tbaa !9
  br label %196, !llvm.loop !12

216:                                              ; preds = %196
  br label %252

217:                                              ; preds = %183
  %218 = load ptr, ptr %13, align 8, !tbaa !5
  %219 = load i32, ptr %218, align 4, !tbaa !9
  %220 = icmp eq i32 %219, 3
  br i1 %220, label %221, label %251

221:                                              ; preds = %217
  %222 = load i32, ptr %31, align 4, !tbaa !9
  %223 = icmp ne i32 %222, 0
  br i1 %223, label %224, label %226

224:                                              ; preds = %221
  %225 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  store i8 67, ptr %225, align 1, !tbaa !11
  br label %228

226:                                              ; preds = %221
  %227 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  store i8 78, ptr %227, align 1, !tbaa !11
  br label %228

228:                                              ; preds = %226, %224
  %229 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %229, ptr %27, align 4, !tbaa !9
  store i32 1, ptr %29, align 4, !tbaa !9
  br label %230

230:                                              ; preds = %247, %228
  %231 = load i32, ptr %29, align 4, !tbaa !9
  %232 = load i32, ptr %27, align 4, !tbaa !9
  %233 = icmp sle i32 %231, %232
  br i1 %233, label %234, label %250

234:                                              ; preds = %230
  %235 = load ptr, ptr %15, align 8, !tbaa !5
  %236 = getelementptr inbounds [1 x i8], ptr %30, i64 0, i64 0
  %237 = load ptr, ptr %16, align 8, !tbaa !5
  %238 = load ptr, ptr %18, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.complex, ptr %238, i64 1
  %240 = load ptr, ptr %20, align 8, !tbaa !5
  %241 = load i32, ptr %29, align 4, !tbaa !9
  %242 = load i32, ptr %25, align 4, !tbaa !9
  %243 = mul nsw i32 %241, %242
  %244 = add nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds %struct.complex, ptr %240, i64 %245
  call void @ctpmv_(ptr noundef %235, ptr noundef %236, ptr noundef @.str.5, ptr noundef %237, ptr noundef %239, ptr noundef %246, ptr noundef @c__1)
  br label %247

247:                                              ; preds = %234
  %248 = load i32, ptr %29, align 4, !tbaa !9
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %29, align 4, !tbaa !9
  br label %230, !llvm.loop !14

250:                                              ; preds = %230
  br label %251

251:                                              ; preds = %250, %217
  br label %252

252:                                              ; preds = %251, %216
  br label %253

253:                                              ; preds = %252, %141
  store i32 1, ptr %33, align 4
  br label %254

254:                                              ; preds = %253, %134, %124, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  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 void @cpptrf_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

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

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

declare void @ctpmv_(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 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; 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 [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@c__1 = external hidden global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @chpgv_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, ptr noundef %11) local_unnamed_addr #0 {
  %13 = alloca i32, align 4
  %14 = alloca [1 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #3
  %15 = load i32, ptr %8, align 4, !tbaa !5
  %narrow = xor i32 %15, -1
  %16 = sext i32 %narrow to i64
  %17 = getelementptr inbounds %struct.complex, ptr %7, i64 %16
  %18 = tail call i32 @lsame_(ptr noundef %1, ptr noundef nonnull @.str) #3
  %19 = tail call i32 @lsame_(ptr noundef %2, ptr noundef nonnull @.str.1) #3
  store i32 0, ptr %11, align 4, !tbaa !5
  %20 = load i32, ptr %0, align 4, !tbaa !5
  %21 = add i32 %20, -4
  %or.cond = icmp ult i32 %21, -3
  br i1 %or.cond, label %.thread.sink.split, label %22

22:                                               ; preds = %12
  %.not = icmp ne i32 %18, 0
  br i1 %.not, label %25, label %23

23:                                               ; preds = %22
  %24 = tail call i32 @lsame_(ptr noundef %1, ptr noundef nonnull @.str.2) #3
  %.not90 = icmp eq i32 %24, 0
  br i1 %.not90, label %.thread.sink.split, label %25

25:                                               ; preds = %23, %22
  %.not91 = icmp eq i32 %19, 0
  br i1 %.not91, label %26, label %28

26:                                               ; preds = %25
  %27 = tail call i32 @lsame_(ptr noundef %2, ptr noundef nonnull @.str.3) #3
  %.not92 = icmp eq i32 %27, 0
  br i1 %.not92, label %.thread.sink.split, label %28

28:                                               ; preds = %26, %25
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %.thread.sink.split, label %31

31:                                               ; preds = %28
  %32 = load i32, ptr %8, align 4, !tbaa !5
  %33 = icmp slt i32 %32, 1
  %34 = icmp ult i32 %32, %29
  %or.cond101 = and i1 %.not, %34
  %or.cond104 = or i1 %33, %or.cond101
  br i1 %or.cond104, label %.thread.sink.split, label %35

35:                                               ; preds = %31
  %.pr = load i32, ptr %11, align 4, !tbaa !5
  %.not93 = icmp eq i32 %.pr, 0
  br i1 %.not93, label %39, label %.thread

.thread.sink.split:                               ; preds = %31, %28, %26, %23, %12
  %.sink = phi i32 [ -1, %12 ], [ -2, %23 ], [ -3, %26 ], [ -4, %28 ], [ -9, %31 ]
  store i32 %.sink, ptr %11, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %35
  %36 = phi i32 [ %.pr, %35 ], [ %.sink, %.thread.sink.split ]
  %37 = sub nsw i32 0, %36
  store i32 %37, ptr %13, align 4, !tbaa !5
  %38 = call i32 @xerbla_(ptr noundef nonnull @.str.4, ptr noundef nonnull %13, i32 noundef 6) #3
  br label %.loopexit

39:                                               ; preds = %35
  %40 = icmp eq i32 %29, 0
  br i1 %40, label %.loopexit, label %41

41:                                               ; preds = %39
  tail call void @cpptrf_(ptr noundef %2, ptr noundef nonnull %3, ptr noundef %5, ptr noundef nonnull %11) #3
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %.not94 = icmp eq i32 %42, 0
  br i1 %.not94, label %46, label %43

43:                                               ; preds = %41
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = add nsw i32 %44, %42
  store i32 %45, ptr %11, align 4, !tbaa !5
  br label %.loopexit

46:                                               ; preds = %41
  tail call void @chpgst_(ptr noundef nonnull %0, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %4, ptr noundef %5, ptr noundef nonnull %11) #3
  tail call void @chpev_(ptr noundef %1, ptr noundef %2, ptr noundef nonnull %3, ptr noundef %4, ptr noundef %6, ptr noundef %7, ptr noundef nonnull %8, ptr noundef %9, ptr noundef %10, ptr noundef nonnull %11) #3
  %.not95 = icmp eq i32 %18, 0
  br i1 %.not95, label %.loopexit, label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr %11, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  %51 = add nsw i32 %49, -1
  %spec.select = select i1 %50, i32 %51, i32 %48
  %52 = load i32, ptr %0, align 4, !tbaa !5
  switch i32 %52, label %.loopexit [
    i32 1, label %53
    i32 2, label %53
    i32 3, label %57
  ]

53:                                               ; preds = %47, %47
  %. = select i1 %.not91, i8 67, i8 78
  store i8 %., ptr %14, align 1, !tbaa !9
  %invariant.gep108 = getelementptr i8, ptr %17, i64 8
  %.not100110 = icmp slt i32 %spec.select, 1
  br i1 %.not100110, label %.loopexit, label %.lr.ph112.preheader

.lr.ph112.preheader:                              ; preds = %53
  %54 = sext i32 %15 to i64
  %55 = zext nneg i32 %spec.select to i64
  br label %.lr.ph112

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %.lr.ph112
  %indvars.iv115 = phi i64 [ 1, %.lr.ph112.preheader ], [ %indvars.iv.next116, %.lr.ph112 ]
  %56 = mul nsw i64 %indvars.iv115, %54
  %gep109 = getelementptr %struct.complex, ptr %invariant.gep108, i64 %56
  call void @ctpsv_(ptr noundef %2, ptr noundef nonnull %14, ptr noundef nonnull @.str.5, ptr noundef nonnull %3, ptr noundef %5, ptr noundef %gep109, ptr noundef nonnull @c__1) #3
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %.not100.not = icmp ult i64 %indvars.iv115, %55
  br i1 %.not100.not, label %.lr.ph112, label %.loopexit, !llvm.loop !10

57:                                               ; preds = %47
  %.102 = select i1 %.not91, i8 78, i8 67
  store i8 %.102, ptr %14, align 1, !tbaa !9
  %invariant.gep = getelementptr i8, ptr %17, i64 8
  %.not97106 = icmp slt i32 %spec.select, 1
  br i1 %.not97106, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %57
  %58 = sext i32 %15 to i64
  %59 = zext nneg i32 %spec.select to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %60 = mul nsw i64 %indvars.iv, %58
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %60
  call void @ctpmv_(ptr noundef %2, ptr noundef nonnull %14, ptr noundef nonnull @.str.5, ptr noundef nonnull %3, ptr noundef %5, ptr noundef %gep, ptr noundef nonnull @c__1) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not97.not = icmp ult i64 %indvars.iv, %59
  br i1 %.not97.not, label %.lr.ph, label %.loopexit, !llvm.loop !12

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph112, %57, %53, %46, %47, %39, %43, %.thread
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #3
  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 void @cpptrf_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @chpev_(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 @ctpsv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ctpmv_(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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass