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

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

; Function Attrs: nounwind uwtable
define dso_local double @zlanht_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca { double, double }, align 8
  %17 = alloca { double, double }, align 8
  %18 = alloca { double, double }, align 8
  %19 = alloca { double, double }, align 8
  %20 = alloca { double, double }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.doublecomplex, ptr %21, i32 -1
  store ptr %22, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds double, ptr %23, i32 -1
  store ptr %24, ptr %7, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = icmp sle i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %4
  store double 0.000000e+00, ptr %14, align 8, !tbaa !11
  br label %308

29:                                               ; preds = %4
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call i32 @lsame_(ptr noundef %30, ptr noundef @.str)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %107

33:                                               ; preds = %29
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds double, ptr %34, i64 %37
  %39 = load double, ptr %38, align 8, !tbaa !11
  store double %39, ptr %11, align 8, !tbaa !11
  %40 = load double, ptr %11, align 8, !tbaa !11
  %41 = fcmp oge double %40, 0.000000e+00
  br i1 %41, label %42, label %44

42:                                               ; preds = %33
  %43 = load double, ptr %11, align 8, !tbaa !11
  br label %47

44:                                               ; preds = %33
  %45 = load double, ptr %11, align 8, !tbaa !11
  %46 = fneg double %45
  br label %47

47:                                               ; preds = %44, %42
  %48 = phi double [ %43, %42 ], [ %46, %44 ]
  store double %48, ptr %14, align 8, !tbaa !11
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  store i32 %51, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %103, %47
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %56, label %106

56:                                               ; preds = %52
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds double, ptr %57, i64 %59
  %61 = load double, ptr %60, align 8, !tbaa !11
  store double %61, ptr %11, align 8, !tbaa !11
  %62 = load double, ptr %11, align 8, !tbaa !11
  %63 = fcmp oge double %62, 0.000000e+00
  br i1 %63, label %64, label %66

64:                                               ; preds = %56
  %65 = load double, ptr %11, align 8, !tbaa !11
  br label %69

66:                                               ; preds = %56
  %67 = load double, ptr %11, align 8, !tbaa !11
  %68 = fneg double %67
  br label %69

69:                                               ; preds = %66, %64
  %70 = phi double [ %65, %64 ], [ %68, %66 ]
  store double %70, ptr %15, align 8, !tbaa !11
  %71 = load double, ptr %14, align 8, !tbaa !11
  %72 = load double, ptr %15, align 8, !tbaa !11
  %73 = fcmp olt double %71, %72
  br i1 %73, label %77, label %74

74:                                               ; preds = %69
  %75 = call i32 @disnan_(ptr noundef %15)
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %74, %69
  %78 = load double, ptr %15, align 8, !tbaa !11
  store double %78, ptr %14, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %77, %74
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.doublecomplex, ptr %80, i64 %82
  %84 = call { double, double } @Cd(ptr noundef %83)
  %85 = extractvalue { double, double } %84, 0
  %86 = extractvalue { double, double } %84, 1
  %87 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %88 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  store double %85, ptr %87, align 8
  store double %86, ptr %88, align 8
  %89 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %90 = load double, ptr %89, align 8
  %91 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %92 = load double, ptr %91, align 8
  %93 = call double @cabs(double noundef %90, double noundef %92) #5
  store double %93, ptr %15, align 8, !tbaa !11
  %94 = load double, ptr %14, align 8, !tbaa !11
  %95 = load double, ptr %15, align 8, !tbaa !11
  %96 = fcmp olt double %94, %95
  br i1 %96, label %100, label %97

97:                                               ; preds = %79
  %98 = call i32 @disnan_(ptr noundef %15)
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %102

100:                                              ; preds = %97, %79
  %101 = load double, ptr %15, align 8, !tbaa !11
  store double %101, ptr %14, align 8, !tbaa !11
  br label %102

102:                                              ; preds = %100, %97
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !9
  br label %52, !llvm.loop !13

106:                                              ; preds = %52
  br label %307

107:                                              ; preds = %29
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = call i32 @lsame_(ptr noundef %108, ptr noundef @.str.1)
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %120, label %111

111:                                              ; preds = %107
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = zext i8 %113 to i32
  %115 = icmp eq i32 %114, 49
  br i1 %115, label %120, label %116

116:                                              ; preds = %111
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call i32 @lsame_(ptr noundef %117, ptr noundef @.str.2)
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %277

120:                                              ; preds = %116, %111, %107
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = icmp eq i32 %122, 1
  br i1 %123, label %124, label %140

124:                                              ; preds = %120
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds double, ptr %125, i64 1
  %127 = load double, ptr %126, align 8, !tbaa !11
  %128 = fcmp oge double %127, 0.000000e+00
  br i1 %128, label %129, label %133

129:                                              ; preds = %124
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = getelementptr inbounds double, ptr %130, i64 1
  %132 = load double, ptr %131, align 8, !tbaa !11
  br label %138

133:                                              ; preds = %124
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds double, ptr %134, i64 1
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = fneg double %136
  br label %138

138:                                              ; preds = %133, %129
  %139 = phi double [ %132, %129 ], [ %137, %133 ]
  store double %139, ptr %14, align 8, !tbaa !11
  br label %276

140:                                              ; preds = %120
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds double, ptr %141, i64 1
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = fcmp oge double %143, 0.000000e+00
  br i1 %144, label %145, label %149

145:                                              ; preds = %140
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds double, ptr %146, i64 1
  %148 = load double, ptr %147, align 8, !tbaa !11
  br label %154

149:                                              ; preds = %140
  %150 = load ptr, ptr %7, align 8, !tbaa !5
  %151 = getelementptr inbounds double, ptr %150, i64 1
  %152 = load double, ptr %151, align 8, !tbaa !11
  %153 = fneg double %152
  br label %154

154:                                              ; preds = %149, %145
  %155 = phi double [ %148, %145 ], [ %153, %149 ]
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.doublecomplex, ptr %156, i64 1
  %158 = call { double, double } @Cd(ptr noundef %157)
  %159 = extractvalue { double, double } %158, 0
  %160 = extractvalue { double, double } %158, 1
  %161 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %162 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  store double %159, ptr %161, align 8
  store double %160, ptr %162, align 8
  %163 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %164 = load double, ptr %163, align 8
  %165 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %166 = load double, ptr %165, align 8
  %167 = call double @cabs(double noundef %164, double noundef %166) #5
  %168 = fadd double %155, %167
  store double %168, ptr %14, align 8, !tbaa !11
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = load i32, ptr %170, align 4, !tbaa !9
  %172 = sub nsw i32 %171, 1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds %struct.doublecomplex, ptr %169, i64 %173
  %175 = call { double, double } @Cd(ptr noundef %174)
  %176 = extractvalue { double, double } %175, 0
  %177 = extractvalue { double, double } %175, 1
  %178 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %179 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  store double %176, ptr %178, align 8
  store double %177, ptr %179, align 8
  %180 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %181 = load double, ptr %180, align 8
  %182 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %183 = load double, ptr %182, align 8
  %184 = call double @cabs(double noundef %181, double noundef %183) #5
  %185 = load ptr, ptr %7, align 8, !tbaa !5
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = load i32, ptr %186, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds double, ptr %185, i64 %188
  %190 = load double, ptr %189, align 8, !tbaa !11
  store double %190, ptr %11, align 8, !tbaa !11
  %191 = load double, ptr %11, align 8, !tbaa !11
  %192 = fcmp oge double %191, 0.000000e+00
  br i1 %192, label %193, label %195

193:                                              ; preds = %154
  %194 = load double, ptr %11, align 8, !tbaa !11
  br label %198

195:                                              ; preds = %154
  %196 = load double, ptr %11, align 8, !tbaa !11
  %197 = fneg double %196
  br label %198

198:                                              ; preds = %195, %193
  %199 = phi double [ %194, %193 ], [ %197, %195 ]
  %200 = fadd double %184, %199
  store double %200, ptr %15, align 8, !tbaa !11
  %201 = load double, ptr %14, align 8, !tbaa !11
  %202 = load double, ptr %15, align 8, !tbaa !11
  %203 = fcmp olt double %201, %202
  br i1 %203, label %207, label %204

204:                                              ; preds = %198
  %205 = call i32 @disnan_(ptr noundef %15)
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %209

207:                                              ; preds = %204, %198
  %208 = load double, ptr %15, align 8, !tbaa !11
  store double %208, ptr %14, align 8, !tbaa !11
  br label %209

209:                                              ; preds = %207, %204
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = load i32, ptr %210, align 4, !tbaa !9
  %212 = sub nsw i32 %211, 1
  store i32 %212, ptr %9, align 4, !tbaa !9
  store i32 2, ptr %12, align 4, !tbaa !9
  br label %213

213:                                              ; preds = %272, %209
  %214 = load i32, ptr %12, align 4, !tbaa !9
  %215 = load i32, ptr %9, align 4, !tbaa !9
  %216 = icmp sle i32 %214, %215
  br i1 %216, label %217, label %275

217:                                              ; preds = %213
  %218 = load ptr, ptr %7, align 8, !tbaa !5
  %219 = load i32, ptr %12, align 4, !tbaa !9
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds double, ptr %218, i64 %220
  %222 = load double, ptr %221, align 8, !tbaa !11
  store double %222, ptr %11, align 8, !tbaa !11
  %223 = load double, ptr %11, align 8, !tbaa !11
  %224 = fcmp oge double %223, 0.000000e+00
  br i1 %224, label %225, label %227

225:                                              ; preds = %217
  %226 = load double, ptr %11, align 8, !tbaa !11
  br label %230

227:                                              ; preds = %217
  %228 = load double, ptr %11, align 8, !tbaa !11
  %229 = fneg double %228
  br label %230

230:                                              ; preds = %227, %225
  %231 = phi double [ %226, %225 ], [ %229, %227 ]
  %232 = load ptr, ptr %8, align 8, !tbaa !5
  %233 = load i32, ptr %12, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds %struct.doublecomplex, ptr %232, i64 %234
  %236 = call { double, double } @Cd(ptr noundef %235)
  %237 = extractvalue { double, double } %236, 0
  %238 = extractvalue { double, double } %236, 1
  %239 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %240 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  store double %237, ptr %239, align 8
  store double %238, ptr %240, align 8
  %241 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %242 = load double, ptr %241, align 8
  %243 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %244 = load double, ptr %243, align 8
  %245 = call double @cabs(double noundef %242, double noundef %244) #5
  %246 = fadd double %231, %245
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = load i32, ptr %12, align 4, !tbaa !9
  %249 = sub nsw i32 %248, 1
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds %struct.doublecomplex, ptr %247, i64 %250
  %252 = call { double, double } @Cd(ptr noundef %251)
  %253 = extractvalue { double, double } %252, 0
  %254 = extractvalue { double, double } %252, 1
  %255 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %256 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  store double %253, ptr %255, align 8
  store double %254, ptr %256, align 8
  %257 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %258 = load double, ptr %257, align 8
  %259 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %260 = load double, ptr %259, align 8
  %261 = call double @cabs(double noundef %258, double noundef %260) #5
  %262 = fadd double %246, %261
  store double %262, ptr %15, align 8, !tbaa !11
  %263 = load double, ptr %14, align 8, !tbaa !11
  %264 = load double, ptr %15, align 8, !tbaa !11
  %265 = fcmp olt double %263, %264
  br i1 %265, label %269, label %266

266:                                              ; preds = %230
  %267 = call i32 @disnan_(ptr noundef %15)
  %268 = icmp ne i32 %267, 0
  br i1 %268, label %269, label %271

269:                                              ; preds = %266, %230
  %270 = load double, ptr %15, align 8, !tbaa !11
  store double %270, ptr %14, align 8, !tbaa !11
  br label %271

271:                                              ; preds = %269, %266
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %12, align 4, !tbaa !9
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %12, align 4, !tbaa !9
  br label %213, !llvm.loop !16

275:                                              ; preds = %213
  br label %276

276:                                              ; preds = %275, %138
  br label %306

277:                                              ; preds = %116
  %278 = load ptr, ptr %5, align 8, !tbaa !5
  %279 = call i32 @lsame_(ptr noundef %278, ptr noundef @.str.3)
  %280 = icmp ne i32 %279, 0
  br i1 %280, label %285, label %281

281:                                              ; preds = %277
  %282 = load ptr, ptr %5, align 8, !tbaa !5
  %283 = call i32 @lsame_(ptr noundef %282, ptr noundef @.str.4)
  %284 = icmp ne i32 %283, 0
  br i1 %284, label %285, label %305

285:                                              ; preds = %281, %277
  store double 0.000000e+00, ptr %13, align 8, !tbaa !11
  store double 1.000000e+00, ptr %15, align 8, !tbaa !11
  %286 = load ptr, ptr %6, align 8, !tbaa !5
  %287 = load i32, ptr %286, align 4, !tbaa !9
  %288 = icmp sgt i32 %287, 1
  br i1 %288, label %289, label %297

289:                                              ; preds = %285
  %290 = load ptr, ptr %6, align 8, !tbaa !5
  %291 = load i32, ptr %290, align 4, !tbaa !9
  %292 = sub nsw i32 %291, 1
  store i32 %292, ptr %9, align 4, !tbaa !9
  %293 = load ptr, ptr %8, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.doublecomplex, ptr %293, i64 1
  call void @zlassq_(ptr noundef %9, ptr noundef %294, ptr noundef @c__1, ptr noundef %13, ptr noundef %15)
  %295 = load double, ptr %15, align 8, !tbaa !11
  %296 = fmul double %295, 2.000000e+00
  store double %296, ptr %15, align 8, !tbaa !11
  br label %297

297:                                              ; preds = %289, %285
  %298 = load ptr, ptr %6, align 8, !tbaa !5
  %299 = load ptr, ptr %7, align 8, !tbaa !5
  %300 = getelementptr inbounds double, ptr %299, i64 1
  call void @dlassq_(ptr noundef %298, ptr noundef %300, ptr noundef @c__1, ptr noundef %13, ptr noundef %15)
  %301 = load double, ptr %13, align 8, !tbaa !11
  %302 = load double, ptr %15, align 8, !tbaa !11
  %303 = call double @sqrt(double noundef %302) #5
  %304 = fmul double %301, %303
  store double %304, ptr %14, align 8, !tbaa !11
  br label %305

305:                                              ; preds = %297, %281
  br label %306

306:                                              ; preds = %305, %276
  br label %307

307:                                              ; preds = %306, %106
  br label %308

308:                                              ; preds = %307, %28
  %309 = load double, ptr %14, align 8, !tbaa !11
  store double %309, ptr %10, align 8, !tbaa !11
  %310 = load double, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret double %310
}

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

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

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

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

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

; Function Attrs: nounwind
declare double @sqrt(double 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 = { 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 = { 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 #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 = !{!"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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}


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

; Function Attrs: nounwind uwtable
define dso_local double @zlanht_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %8 = getelementptr inbounds i8, ptr %3, i64 -16
  %9 = getelementptr inbounds i8, ptr %2, i64 -8
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 1
  br i1 %11, label %.loopexit, label %12

12:                                               ; preds = %4
  %13 = tail call i32 @lsame_(ptr noundef %0, ptr noundef nonnull @.str) #6
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %42, label %14

14:                                               ; preds = %12
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds double, ptr %9, i64 %16
  %18 = load double, ptr %17, align 8, !tbaa !9
  %19 = fcmp oge double %18, 0.000000e+00
  %20 = fneg double %18
  %21 = select i1 %19, double %18, double %20
  %.not8488 = icmp slt i32 %15, 2
  br i1 %.not8488, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %14
  %22 = add nsw i32 %15, -1
  %23 = sext i32 %22 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %41 ]
  %.06989 = phi double [ %21, %.lr.ph.preheader ], [ %.2, %41 ]
  %24 = getelementptr inbounds double, ptr %9, i64 %indvars.iv
  %25 = load double, ptr %24, align 8, !tbaa !9
  %26 = fcmp oge double %25, 0.000000e+00
  %27 = fneg double %25
  %28 = select i1 %26, double %25, double %27
  store double %28, ptr %7, align 8, !tbaa !9
  %29 = fcmp olt double %.06989, %28
  br i1 %29, label %32, label %30

30:                                               ; preds = %.lr.ph
  %31 = call i32 @disnan_(ptr noundef nonnull %7) #6
  %.not85 = icmp eq i32 %31, 0
  br i1 %.not85, label %32, label %._crit_edge

._crit_edge:                                      ; preds = %30
  %.pre = load double, ptr %7, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %.lr.ph, %._crit_edge, %30
  %.170 = phi double [ %.06989, %30 ], [ %.pre, %._crit_edge ], [ %28, %.lr.ph ]
  %33 = getelementptr inbounds %struct.doublecomplex, ptr %8, i64 %indvars.iv
  %34 = call { double, double } @Cd(ptr noundef nonnull %33)
  %35 = extractvalue { double, double } %34, 0
  %36 = extractvalue { double, double } %34, 1
  %37 = call double @cabs(double noundef %35, double noundef %36) #6
  store double %37, ptr %7, align 8, !tbaa !9
  %38 = fcmp olt double %.170, %37
  br i1 %38, label %41, label %39

39:                                               ; preds = %32
  %40 = call i32 @disnan_(ptr noundef nonnull %7) #6
  %.not86 = icmp eq i32 %40, 0
  br i1 %.not86, label %41, label %._crit_edge101

._crit_edge101:                                   ; preds = %39
  %.pre102 = load double, ptr %7, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %32, %._crit_edge101, %39
  %.2 = phi double [ %.170, %39 ], [ %.pre102, %._crit_edge101 ], [ %37, %32 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not84.not = icmp slt i64 %indvars.iv, %23
  br i1 %.not84.not, label %.lr.ph, label %.loopexit, !llvm.loop !11

42:                                               ; preds = %12
  %43 = tail call i32 @lsame_(ptr noundef %0, ptr noundef nonnull @.str.1) #6
  %.not77 = icmp eq i32 %43, 0
  br i1 %.not77, label %44, label %49

44:                                               ; preds = %42
  %45 = load i8, ptr %0, align 1, !tbaa !13
  %46 = icmp eq i8 %45, 49
  br i1 %46, label %49, label %47

47:                                               ; preds = %44
  %48 = tail call i32 @lsame_(ptr noundef nonnull %0, ptr noundef nonnull @.str.2) #6
  %.not78 = icmp eq i32 %48, 0
  br i1 %.not78, label %106, label %49

49:                                               ; preds = %47, %44, %42
  %50 = load i32, ptr %1, align 4, !tbaa !5
  %51 = icmp eq i32 %50, 1
  %52 = load double, ptr %2, align 8, !tbaa !9
  %53 = fcmp ult double %52, 0.000000e+00
  %54 = fneg double %52
  %55 = select i1 %53, double %54, double %52
  br i1 %51, label %.loopexit, label %56

56:                                               ; preds = %49
  %57 = tail call { double, double } @Cd(ptr noundef %3)
  %58 = extractvalue { double, double } %57, 0
  %59 = extractvalue { double, double } %57, 1
  %60 = tail call double @cabs(double noundef %58, double noundef %59) #6
  %61 = fadd double %55, %60
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr %struct.doublecomplex, ptr %8, i64 %63
  %65 = getelementptr i8, ptr %64, i64 -16
  %66 = tail call { double, double } @Cd(ptr noundef %65)
  %67 = extractvalue { double, double } %66, 0
  %68 = extractvalue { double, double } %66, 1
  %69 = tail call double @cabs(double noundef %67, double noundef %68) #6
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds double, ptr %9, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = fcmp oge double %73, 0.000000e+00
  %75 = fneg double %73
  %76 = select i1 %74, double %73, double %75
  %77 = fadd double %69, %76
  store double %77, ptr %7, align 8, !tbaa !9
  %78 = fcmp olt double %61, %77
  br i1 %78, label %81, label %79

79:                                               ; preds = %56
  %80 = call i32 @disnan_(ptr noundef nonnull %7) #6
  %.not81 = icmp eq i32 %80, 0
  br i1 %.not81, label %81, label %._crit_edge103

._crit_edge103:                                   ; preds = %79
  %.pre104 = load double, ptr %7, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %56, %._crit_edge103, %79
  %.3 = phi double [ %61, %79 ], [ %.pre104, %._crit_edge103 ], [ %77, %56 ]
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %.not8291 = icmp slt i32 %82, 3
  br i1 %.not8291, label %.loopexit, label %.lr.ph94.preheader

.lr.ph94.preheader:                               ; preds = %81
  %83 = add nsw i32 %82, -1
  %84 = sext i32 %83 to i64
  br label %.lr.ph94

.lr.ph94:                                         ; preds = %.lr.ph94.preheader, %105
  %indvars.iv98 = phi i64 [ 2, %.lr.ph94.preheader ], [ %indvars.iv.next99, %105 ]
  %.492 = phi double [ %.3, %.lr.ph94.preheader ], [ %.5, %105 ]
  %85 = getelementptr inbounds double, ptr %9, i64 %indvars.iv98
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fcmp oge double %86, 0.000000e+00
  %88 = fneg double %86
  %89 = select i1 %87, double %86, double %88
  %90 = getelementptr inbounds %struct.doublecomplex, ptr %8, i64 %indvars.iv98
  %91 = call { double, double } @Cd(ptr noundef nonnull %90)
  %92 = extractvalue { double, double } %91, 0
  %93 = extractvalue { double, double } %91, 1
  %94 = call double @cabs(double noundef %92, double noundef %93) #6
  %95 = fadd double %89, %94
  %96 = getelementptr i8, ptr %90, i64 -16
  %97 = call { double, double } @Cd(ptr noundef %96)
  %98 = extractvalue { double, double } %97, 0
  %99 = extractvalue { double, double } %97, 1
  %100 = call double @cabs(double noundef %98, double noundef %99) #6
  %101 = fadd double %95, %100
  store double %101, ptr %7, align 8, !tbaa !9
  %102 = fcmp olt double %.492, %101
  br i1 %102, label %105, label %103

103:                                              ; preds = %.lr.ph94
  %104 = call i32 @disnan_(ptr noundef nonnull %7) #6
  %.not83 = icmp eq i32 %104, 0
  br i1 %.not83, label %105, label %._crit_edge105

._crit_edge105:                                   ; preds = %103
  %.pre106 = load double, ptr %7, align 8, !tbaa !9
  br label %105

105:                                              ; preds = %.lr.ph94, %._crit_edge105, %103
  %.5 = phi double [ %.492, %103 ], [ %.pre106, %._crit_edge105 ], [ %101, %.lr.ph94 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %.not82.not = icmp slt i64 %indvars.iv98, %84
  br i1 %.not82.not, label %.lr.ph94, label %.loopexit, !llvm.loop !14

106:                                              ; preds = %47
  %107 = tail call i32 @lsame_(ptr noundef nonnull %0, ptr noundef nonnull @.str.3) #6
  %.not79 = icmp eq i32 %107, 0
  br i1 %.not79, label %108, label %110

108:                                              ; preds = %106
  %109 = tail call i32 @lsame_(ptr noundef nonnull %0, ptr noundef nonnull @.str.4) #6
  %.not80 = icmp eq i32 %109, 0
  br i1 %.not80, label %.loopexit, label %110

110:                                              ; preds = %108, %106
  store double 0.000000e+00, ptr %6, align 8, !tbaa !9
  store double 1.000000e+00, ptr %7, align 8, !tbaa !9
  %111 = load i32, ptr %1, align 4, !tbaa !5
  %112 = icmp sgt i32 %111, 1
  br i1 %112, label %113, label %117

113:                                              ; preds = %110
  %114 = add nsw i32 %111, -1
  store i32 %114, ptr %5, align 4, !tbaa !5
  call void @zlassq_(ptr noundef nonnull %5, ptr noundef %3, ptr noundef nonnull @c__1, ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %115 = load double, ptr %7, align 8, !tbaa !9
  %116 = fmul double %115, 2.000000e+00
  store double %116, ptr %7, align 8, !tbaa !9
  br label %117

117:                                              ; preds = %113, %110
  call void @dlassq_(ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull @c__1, ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %118 = load double, ptr %6, align 8, !tbaa !9
  %119 = load double, ptr %7, align 8, !tbaa !9
  %120 = call double @sqrt(double noundef %119) #6
  %121 = fmul double %118, %120
  br label %.loopexit

.loopexit:                                        ; preds = %41, %105, %49, %14, %81, %4, %108, %117
  %.6 = phi double [ %121, %117 ], [ undef, %108 ], [ 0.000000e+00, %4 ], [ %.3, %81 ], [ %21, %14 ], [ %55, %49 ], [ %.5, %105 ], [ %.2, %41 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  ret double %.6
}

; 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 @disnan_(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare double @cabs(double noundef, double noundef) local_unnamed_addr #3

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

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

declare void @dlassq_(ptr noundef, 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 #5

; 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 = { nofree 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 = { 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 #5 = { 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 #6 = { 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"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}


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