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

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

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

44:                                               ; preds = %8
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -1, ptr %45, align 4, !tbaa !9
  br label %108

46:                                               ; preds = %8
  %47 = load ptr, ptr %10, align 8, !tbaa !5
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 1
  br i1 %49, label %63, label %50

50:                                               ; preds = %46
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp sge i32 1, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  br label %60

57:                                               ; preds = %50
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = load i32, ptr %58, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %57, %56
  %61 = phi i32 [ 1, %56 ], [ %59, %57 ]
  %62 = icmp sgt i32 %52, %61
  br i1 %62, label %63, label %65

63:                                               ; preds = %60, %46
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -2, ptr %64, align 4, !tbaa !9
  br label %107

65:                                               ; preds = %60
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = icmp sle i32 %69, %71
  br i1 %72, label %73, label %76

73:                                               ; preds = %65
  %74 = load ptr, ptr %10, align 8, !tbaa !5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  br label %79

76:                                               ; preds = %65
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = load i32, ptr %77, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %76, %73
  %80 = phi i32 [ %75, %73 ], [ %78, %76 ]
  %81 = icmp slt i32 %67, %80
  br i1 %81, label %88, label %82

82:                                               ; preds = %79
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = load i32, ptr %83, align 4, !tbaa !9
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = icmp sgt i32 %84, %86
  br i1 %87, label %88, label %90

88:                                               ; preds = %82, %79
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -3, ptr %89, align 4, !tbaa !9
  br label %106

90:                                               ; preds = %82
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = icmp sge i32 1, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %90
  br label %100

97:                                               ; preds = %90
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = load i32, ptr %98, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %97, %96
  %101 = phi i32 [ 1, %96 ], [ %99, %97 ]
  %102 = icmp slt i32 %92, %101
  br i1 %102, label %103, label %105

103:                                              ; preds = %100
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 -5, ptr %104, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %103, %100
  br label %106

106:                                              ; preds = %105, %88
  br label %107

107:                                              ; preds = %106, %63
  br label %108

108:                                              ; preds = %107, %44
  %109 = load ptr, ptr %16, align 8, !tbaa !5
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %117

112:                                              ; preds = %108
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = load i32, ptr %113, align 4, !tbaa !9
  %115 = sub nsw i32 0, %114
  store i32 %115, ptr %19, align 4, !tbaa !9
  %116 = call i32 @xerbla_(ptr noundef @.str, ptr noundef %19, i32 noundef 6)
  store i32 1, ptr %25, align 4
  br label %286

117:                                              ; preds = %108
  %118 = load ptr, ptr %11, align 8, !tbaa !5
  %119 = load i32, ptr %118, align 4, !tbaa !9
  %120 = sub nsw i32 %119, 1
  store i32 %120, ptr %19, align 4, !tbaa !9
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  store i32 %122, ptr %23, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %282, %117
  %124 = load i32, ptr %23, align 4, !tbaa !9
  %125 = load i32, ptr %19, align 4, !tbaa !9
  %126 = icmp sle i32 %124, %125
  br i1 %126, label %127, label %285

127:                                              ; preds = %123
  %128 = load i32, ptr %23, align 4, !tbaa !9
  %129 = add nsw i32 %128, 1
  %130 = load i32, ptr %23, align 4, !tbaa !9
  %131 = load i32, ptr %17, align 4, !tbaa !9
  %132 = mul nsw i32 %130, %131
  %133 = add nsw i32 %129, %132
  store i32 %133, ptr %20, align 4, !tbaa !9
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = load i32, ptr %20, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.doublecomplex, ptr %134, i64 %136
  %138 = getelementptr inbounds %struct.doublecomplex, ptr %137, i32 0, i32 0
  %139 = load double, ptr %138, align 8, !tbaa !11
  %140 = getelementptr inbounds %struct.doublecomplex, ptr %24, i32 0, i32 0
  store double %139, ptr %140, align 8, !tbaa !11
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = load i32, ptr %20, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %struct.doublecomplex, ptr %141, i64 %143
  %145 = getelementptr inbounds %struct.doublecomplex, ptr %144, i32 0, i32 1
  %146 = load double, ptr %145, align 8, !tbaa !14
  %147 = getelementptr inbounds %struct.doublecomplex, ptr %24, i32 0, i32 1
  store double %146, ptr %147, align 8, !tbaa !14
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load i32, ptr %148, align 4, !tbaa !9
  %150 = load i32, ptr %23, align 4, !tbaa !9
  %151 = sub nsw i32 %149, %150
  store i32 %151, ptr %20, align 4, !tbaa !9
  %152 = load i32, ptr %23, align 4, !tbaa !9
  %153 = add nsw i32 %152, 2
  store i32 %153, ptr %21, align 4, !tbaa !9
  %154 = load ptr, ptr %12, align 8, !tbaa !5
  %155 = load i32, ptr %21, align 4, !tbaa !9
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = load i32, ptr %156, align 4, !tbaa !9
  %158 = icmp sle i32 %155, %157
  br i1 %158, label %159, label %161

159:                                              ; preds = %127
  %160 = load i32, ptr %21, align 4, !tbaa !9
  br label %164

161:                                              ; preds = %127
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = load i32, ptr %162, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %161, %159
  %165 = phi i32 [ %160, %159 ], [ %163, %161 ]
  %166 = load i32, ptr %23, align 4, !tbaa !9
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = mul nsw i32 %166, %167
  %169 = add nsw i32 %165, %168
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.doublecomplex, ptr %154, i64 %170
  %172 = load ptr, ptr %14, align 8, !tbaa !5
  %173 = load i32, ptr %23, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds %struct.doublecomplex, ptr %172, i64 %174
  call void @zlarfg_(ptr noundef %20, ptr noundef %24, ptr noundef %171, ptr noundef @c__1, ptr noundef %175)
  %176 = load i32, ptr %23, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  %178 = load i32, ptr %23, align 4, !tbaa !9
  %179 = load i32, ptr %17, align 4, !tbaa !9
  %180 = mul nsw i32 %178, %179
  %181 = add nsw i32 %177, %180
  store i32 %181, ptr %20, align 4, !tbaa !9
  %182 = load ptr, ptr %12, align 8, !tbaa !5
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct.doublecomplex, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct.doublecomplex, ptr %185, i32 0, i32 0
  store double 1.000000e+00, ptr %186, align 8, !tbaa !11
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  %188 = load i32, ptr %20, align 4, !tbaa !9
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds %struct.doublecomplex, ptr %187, i64 %189
  %191 = getelementptr inbounds %struct.doublecomplex, ptr %190, i32 0, i32 1
  store double 0.000000e+00, ptr %191, align 8, !tbaa !14
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  %193 = load i32, ptr %192, align 4, !tbaa !9
  %194 = load i32, ptr %23, align 4, !tbaa !9
  %195 = sub nsw i32 %193, %194
  store i32 %195, ptr %20, align 4, !tbaa !9
  %196 = load ptr, ptr %11, align 8, !tbaa !5
  %197 = load ptr, ptr %12, align 8, !tbaa !5
  %198 = load i32, ptr %23, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  %200 = load i32, ptr %23, align 4, !tbaa !9
  %201 = load i32, ptr %17, align 4, !tbaa !9
  %202 = mul nsw i32 %200, %201
  %203 = add nsw i32 %199, %202
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds %struct.doublecomplex, ptr %197, i64 %204
  %206 = load ptr, ptr %14, align 8, !tbaa !5
  %207 = load i32, ptr %23, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds %struct.doublecomplex, ptr %206, i64 %208
  %210 = load ptr, ptr %12, align 8, !tbaa !5
  %211 = load i32, ptr %23, align 4, !tbaa !9
  %212 = add nsw i32 %211, 1
  %213 = load i32, ptr %17, align 4, !tbaa !9
  %214 = mul nsw i32 %212, %213
  %215 = add nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds %struct.doublecomplex, ptr %210, i64 %216
  %218 = load ptr, ptr %13, align 8, !tbaa !5
  %219 = load ptr, ptr %15, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.doublecomplex, ptr %219, i64 1
  call void @zlarf_(ptr noundef @.str.1, ptr noundef %196, ptr noundef %20, ptr noundef %205, ptr noundef @c__1, ptr noundef %209, ptr noundef %217, ptr noundef %218, ptr noundef %220)
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  %222 = load i32, ptr %221, align 4, !tbaa !9
  %223 = load i32, ptr %23, align 4, !tbaa !9
  %224 = sub nsw i32 %222, %223
  store i32 %224, ptr %20, align 4, !tbaa !9
  %225 = load ptr, ptr %9, align 8, !tbaa !5
  %226 = load i32, ptr %225, align 4, !tbaa !9
  %227 = load i32, ptr %23, align 4, !tbaa !9
  %228 = sub nsw i32 %226, %227
  store i32 %228, ptr %21, align 4, !tbaa !9
  %229 = load ptr, ptr %14, align 8, !tbaa !5
  %230 = load i32, ptr %23, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds %struct.doublecomplex, ptr %229, i64 %231
  %233 = call { double, double } @Cd(ptr noundef %232)
  %234 = extractvalue { double, double } %233, 0
  %235 = extractvalue { double, double } %233, 1
  %236 = fneg double %235
  %237 = call ptr @_pCd(ptr noundef %22)
  %238 = getelementptr inbounds { double, double }, ptr %237, i32 0, i32 0
  %239 = getelementptr inbounds { double, double }, ptr %237, i32 0, i32 1
  store double %234, ptr %238, align 8
  store double %236, ptr %239, align 8
  %240 = load ptr, ptr %12, align 8, !tbaa !5
  %241 = load i32, ptr %23, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  %243 = load i32, ptr %23, align 4, !tbaa !9
  %244 = load i32, ptr %17, align 4, !tbaa !9
  %245 = mul nsw i32 %243, %244
  %246 = add nsw i32 %242, %245
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds %struct.doublecomplex, ptr %240, i64 %247
  %249 = load ptr, ptr %12, align 8, !tbaa !5
  %250 = load i32, ptr %23, align 4, !tbaa !9
  %251 = add nsw i32 %250, 1
  %252 = load i32, ptr %23, align 4, !tbaa !9
  %253 = add nsw i32 %252, 1
  %254 = load i32, ptr %17, align 4, !tbaa !9
  %255 = mul nsw i32 %253, %254
  %256 = add nsw i32 %251, %255
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds %struct.doublecomplex, ptr %249, i64 %257
  %259 = load ptr, ptr %13, align 8, !tbaa !5
  %260 = load ptr, ptr %15, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.doublecomplex, ptr %260, i64 1
  call void @zlarf_(ptr noundef @.str.2, ptr noundef %20, ptr noundef %21, ptr noundef %248, ptr noundef @c__1, ptr noundef %22, ptr noundef %258, ptr noundef %259, ptr noundef %261)
  %262 = load i32, ptr %23, align 4, !tbaa !9
  %263 = add nsw i32 %262, 1
  %264 = load i32, ptr %23, align 4, !tbaa !9
  %265 = load i32, ptr %17, align 4, !tbaa !9
  %266 = mul nsw i32 %264, %265
  %267 = add nsw i32 %263, %266
  store i32 %267, ptr %20, align 4, !tbaa !9
  %268 = getelementptr inbounds %struct.doublecomplex, ptr %24, i32 0, i32 0
  %269 = load double, ptr %268, align 8, !tbaa !11
  %270 = load ptr, ptr %12, align 8, !tbaa !5
  %271 = load i32, ptr %20, align 4, !tbaa !9
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds %struct.doublecomplex, ptr %270, i64 %272
  %274 = getelementptr inbounds %struct.doublecomplex, ptr %273, i32 0, i32 0
  store double %269, ptr %274, align 8, !tbaa !11
  %275 = getelementptr inbounds %struct.doublecomplex, ptr %24, i32 0, i32 1
  %276 = load double, ptr %275, align 8, !tbaa !14
  %277 = load ptr, ptr %12, align 8, !tbaa !5
  %278 = load i32, ptr %20, align 4, !tbaa !9
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds %struct.doublecomplex, ptr %277, i64 %279
  %281 = getelementptr inbounds %struct.doublecomplex, ptr %280, i32 0, i32 1
  store double %276, ptr %281, align 8, !tbaa !14
  br label %282

282:                                              ; preds = %164
  %283 = load i32, ptr %23, align 4, !tbaa !9
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %23, align 4, !tbaa !9
  br label %123, !llvm.loop !15

285:                                              ; preds = %123
  store i32 1, ptr %25, align 4
  br label %286

286:                                              ; preds = %285, %112
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, 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
  ret void
}

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden { double, double } @Cd(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @_pCd(ptr noundef) #3

; 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 = { inlinehint 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 #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 = !{!12, !13, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

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

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

23:                                               ; preds = %20
  %spec.select = tail call i32 @llvm.umax.i32(i32 %18, i32 1)
  %24 = icmp ugt i32 %21, %spec.select
  br i1 %24, label %.thread, label %25

25:                                               ; preds = %23
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %. = tail call i32 @llvm.umin.i32(i32 %21, i32 %18)
  %27 = icmp slt i32 %26, %.
  %28 = icmp ugt i32 %26, %18
  %or.cond = or i1 %27, %28
  br i1 %or.cond, label %.thread, label %29

29:                                               ; preds = %25
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = icmp slt i32 %30, %spec.select
  br i1 %31, label %.thread, label %33

.thread:                                          ; preds = %29, %25, %20, %23, %8
  %.sink = phi i32 [ -1, %8 ], [ -2, %23 ], [ -2, %20 ], [ -3, %25 ], [ -5, %29 ]
  %.neg = phi i32 [ 1, %8 ], [ 2, %23 ], [ 2, %20 ], [ 3, %25 ], [ 5, %29 ]
  store i32 %.sink, ptr %7, align 4, !tbaa !5
  store i32 %.neg, ptr %9, align 4, !tbaa !5
  %32 = call i32 @xerbla_(ptr noundef nonnull @.str, ptr noundef nonnull %9, i32 noundef 6) #5
  br label %.loopexit

33:                                               ; preds = %29
  %invariant.gep = getelementptr i8, ptr %16, i64 16
  %.not95100.not = icmp ult i32 %21, %26
  br i1 %.not95100.not, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %33
  %34 = add nsw i32 %26, -1
  %35 = zext nneg i32 %21 to i64
  %36 = sext i32 %14 to i64
  %37 = sext i32 %34 to i64
  br label %38

38:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ %35, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %indvars102 = trunc i64 %indvars.iv to i32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars = trunc i64 %indvars.iv.next to i32
  %39 = mul nsw i64 %indvars.iv, %36
  %40 = mul nsw i32 %14, %indvars102
  %41 = add nsw i32 %40, %indvars
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.doublecomplex, ptr %16, i64 %42
  %44 = load <2 x double>, ptr %43, align 8, !tbaa !9
  store <2 x double> %44, ptr %13, align 16, !tbaa !9
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sub nsw i32 %45, %indvars102
  store i32 %46, ptr %10, align 4, !tbaa !5
  %47 = trunc i64 %indvars.iv to i32
  %48 = add i32 %47, 2
  store i32 %48, ptr %11, align 4, !tbaa !5
  %49 = load i32, ptr %0, align 4, !tbaa !5
  %.98 = call i32 @llvm.smin.i32(i32 %48, i32 %49)
  %50 = sext i32 %.98 to i64
  %51 = getelementptr %struct.doublecomplex, ptr %16, i64 %39
  %52 = getelementptr %struct.doublecomplex, ptr %51, i64 %50
  %53 = getelementptr inbounds %struct.doublecomplex, ptr %17, i64 %indvars.iv
  call void @zlarfg_(ptr noundef nonnull %10, ptr noundef nonnull %13, ptr noundef %52, ptr noundef nonnull @c__1, ptr noundef nonnull %53) #5
  store <2 x double> <double 1.000000e+00, double 0.000000e+00>, ptr %43, align 8, !tbaa !9
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sub nsw i32 %54, %indvars102
  store i32 %55, ptr %10, align 4, !tbaa !5
  %56 = mul nsw i64 %indvars.iv.next, %36
  %57 = mul nsw i32 %14, %indvars
  %gep = getelementptr %struct.doublecomplex, ptr %invariant.gep, i64 %56
  call void @zlarf_(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %10, ptr noundef nonnull %43, ptr noundef nonnull @c__1, ptr noundef nonnull %53, ptr noundef %gep, ptr noundef nonnull %4, ptr noundef %6) #5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sub nsw i32 %58, %indvars102
  store i32 %59, ptr %10, align 4, !tbaa !5
  %60 = load i32, ptr %0, align 4, !tbaa !5
  %61 = sub nsw i32 %60, %indvars102
  store i32 %61, ptr %11, align 4, !tbaa !5
  %62 = call { double, double } @Cd(ptr noundef nonnull %53)
  %63 = extractvalue { double, double } %62, 0
  %64 = extractvalue { double, double } %62, 1
  %65 = fneg double %64
  %66 = call ptr @_pCd(ptr noundef nonnull %12)
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  store double %63, ptr %66, align 8
  store double %65, ptr %67, align 8
  %68 = sext i32 %57 to i64
  %69 = getelementptr %struct.doublecomplex, ptr %16, i64 %indvars.iv.next
  %70 = getelementptr %struct.doublecomplex, ptr %69, i64 %68
  call void @zlarf_(ptr noundef nonnull @.str.2, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %43, ptr noundef nonnull @c__1, ptr noundef nonnull %12, ptr noundef %70, ptr noundef nonnull %4, ptr noundef %6) #5
  store i32 %41, ptr %10, align 4, !tbaa !5
  %71 = load <2 x double>, ptr %13, align 16, !tbaa !9
  store <2 x double> %71, ptr %43, align 8, !tbaa !9
  %.not95.not = icmp slt i64 %indvars.iv, %37
  br i1 %.not95.not, label %38, label %.loopexit, !llvm.loop !11

.loopexit:                                        ; preds = %38, %33, %.thread
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #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 @xerbla_(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden { double, double } @Cd(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @_pCd(ptr noundef) local_unnamed_addr #3

; 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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.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 = { inlinehint 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 #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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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