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

; 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"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@c__1 = external hidden global i32, align 4
@c_n1 = external hidden global i32, align 4

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

61:                                               ; preds = %100, %7
  %62 = load i32, ptr %22, align 4, !tbaa !9
  %63 = load i32, ptr %17, align 4, !tbaa !9
  %64 = icmp sle i32 %62, %63
  br i1 %64, label %65, label %103

65:                                               ; preds = %61
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !9
  store i32 %67, ptr %18, align 4, !tbaa !9
  %68 = load i32, ptr %22, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %23, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %96, %65
  %71 = load i32, ptr %23, align 4, !tbaa !9
  %72 = load i32, ptr %18, align 4, !tbaa !9
  %73 = icmp sle i32 %71, %72
  br i1 %73, label %74, label %99

74:                                               ; preds = %70
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i32, ptr %23, align 4, !tbaa !9
  %77 = load i32, ptr %22, align 4, !tbaa !9
  %78 = load i32, ptr %15, align 4, !tbaa !9
  %79 = mul nsw i32 %77, %78
  %80 = add nsw i32 %76, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds double, ptr %75, i64 %81
  %83 = load double, ptr %82, align 8, !tbaa !11
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load i32, ptr %22, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds double, ptr %84, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !11
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = load i32, ptr %23, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds double, ptr %89, i64 %91
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = fneg double %83
  %95 = call double @llvm.fmuladd.f64(double %94, double %88, double %93)
  store double %95, ptr %92, align 8, !tbaa !11
  br label %96

96:                                               ; preds = %74
  %97 = load i32, ptr %23, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %23, align 4, !tbaa !9
  br label %70, !llvm.loop !13

99:                                               ; preds = %70
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %22, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %22, align 4, !tbaa !9
  br label %61, !llvm.loop !15

103:                                              ; preds = %61
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  store double 1.000000e+00, ptr %104, align 8, !tbaa !11
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds double, ptr %106, i64 1
  %108 = call i32 @idamax_(ptr noundef %105, ptr noundef %107, ptr noundef @c__1)
  store i32 %108, ptr %22, align 4, !tbaa !9
  %109 = load double, ptr %25, align 8, !tbaa !11
  %110 = fmul double %109, 2.000000e+00
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = load i32, ptr %22, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %111, i64 %113
  %115 = load double, ptr %114, align 8, !tbaa !11
  store double %115, ptr %19, align 8, !tbaa !11
  %116 = load double, ptr %19, align 8, !tbaa !11
  %117 = fcmp oge double %116, 0.000000e+00
  br i1 %117, label %118, label %120

118:                                              ; preds = %103
  %119 = load double, ptr %19, align 8, !tbaa !11
  br label %123

120:                                              ; preds = %103
  %121 = load double, ptr %19, align 8, !tbaa !11
  %122 = fneg double %121
  br label %123

123:                                              ; preds = %120, %118
  %124 = phi double [ %119, %118 ], [ %122, %120 ]
  %125 = fmul double %110, %124
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = load ptr, ptr %8, align 8, !tbaa !5
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = mul nsw i32 %130, %131
  %133 = add nsw i32 %128, %132
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds double, ptr %126, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !11
  store double %136, ptr %20, align 8, !tbaa !11
  %137 = load double, ptr %20, align 8, !tbaa !11
  %138 = fcmp oge double %137, 0.000000e+00
  br i1 %138, label %139, label %141

139:                                              ; preds = %123
  %140 = load double, ptr %20, align 8, !tbaa !11
  br label %144

141:                                              ; preds = %123
  %142 = load double, ptr %20, align 8, !tbaa !11
  %143 = fneg double %142
  br label %144

144:                                              ; preds = %141, %139
  %145 = phi double [ %140, %139 ], [ %143, %141 ]
  %146 = fcmp ogt double %125, %145
  br i1 %146, label %147, label %170

147:                                              ; preds = %144
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load i32, ptr %22, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds double, ptr %148, i64 %150
  %152 = load double, ptr %151, align 8, !tbaa !11
  store double %152, ptr %19, align 8, !tbaa !11
  %153 = load double, ptr %19, align 8, !tbaa !11
  %154 = fcmp oge double %153, 0.000000e+00
  br i1 %154, label %155, label %157

155:                                              ; preds = %147
  %156 = load double, ptr %19, align 8, !tbaa !11
  br label %160

157:                                              ; preds = %147
  %158 = load double, ptr %19, align 8, !tbaa !11
  %159 = fneg double %158
  br label %160

160:                                              ; preds = %157, %155
  %161 = phi double [ %156, %155 ], [ %159, %157 ]
  %162 = fdiv double 5.000000e-01, %161
  store double %162, ptr %21, align 8, !tbaa !11
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = load ptr, ptr %11, align 8, !tbaa !5
  %165 = getelementptr inbounds double, ptr %164, i64 1
  call void @dscal_(ptr noundef %163, ptr noundef %21, ptr noundef %165, ptr noundef @c__1)
  %166 = load double, ptr %21, align 8, !tbaa !11
  %167 = load ptr, ptr %14, align 8, !tbaa !5
  %168 = load double, ptr %167, align 8, !tbaa !11
  %169 = fmul double %168, %166
  store double %169, ptr %167, align 8, !tbaa !11
  br label %170

170:                                              ; preds = %160, %144
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = load i32, ptr %171, align 4, !tbaa !9
  store i32 %172, ptr %22, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %230, %170
  %174 = load i32, ptr %22, align 4, !tbaa !9
  %175 = icmp sge i32 %174, 1
  br i1 %175, label %176, label %233

176:                                              ; preds = %173
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load i32, ptr %22, align 4, !tbaa !9
  %179 = load i32, ptr %22, align 4, !tbaa !9
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = mul nsw i32 %179, %180
  %182 = add nsw i32 %178, %181
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds double, ptr %177, i64 %183
  %185 = load double, ptr %184, align 8, !tbaa !11
  %186 = fdiv double 1.000000e+00, %185
  store double %186, ptr %21, align 8, !tbaa !11
  %187 = load double, ptr %21, align 8, !tbaa !11
  %188 = load ptr, ptr %11, align 8, !tbaa !5
  %189 = load i32, ptr %22, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds double, ptr %188, i64 %190
  %192 = load double, ptr %191, align 8, !tbaa !11
  %193 = fmul double %192, %187
  store double %193, ptr %191, align 8, !tbaa !11
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = load i32, ptr %194, align 4, !tbaa !9
  store i32 %195, ptr %17, align 4, !tbaa !9
  %196 = load i32, ptr %22, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %23, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %226, %176
  %199 = load i32, ptr %23, align 4, !tbaa !9
  %200 = load i32, ptr %17, align 4, !tbaa !9
  %201 = icmp sle i32 %199, %200
  br i1 %201, label %202, label %229

202:                                              ; preds = %198
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = load i32, ptr %23, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds double, ptr %203, i64 %205
  %207 = load double, ptr %206, align 8, !tbaa !11
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = load i32, ptr %22, align 4, !tbaa !9
  %210 = load i32, ptr %23, align 4, !tbaa !9
  %211 = load i32, ptr %15, align 4, !tbaa !9
  %212 = mul nsw i32 %210, %211
  %213 = add nsw i32 %209, %212
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds double, ptr %208, i64 %214
  %216 = load double, ptr %215, align 8, !tbaa !11
  %217 = load double, ptr %21, align 8, !tbaa !11
  %218 = fmul double %216, %217
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  %220 = load i32, ptr %22, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds double, ptr %219, i64 %221
  %223 = load double, ptr %222, align 8, !tbaa !11
  %224 = fneg double %207
  %225 = call double @llvm.fmuladd.f64(double %224, double %218, double %223)
  store double %225, ptr %222, align 8, !tbaa !11
  br label %226

226:                                              ; preds = %202
  %227 = load i32, ptr %23, align 4, !tbaa !9
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %23, align 4, !tbaa !9
  br label %198, !llvm.loop !16

229:                                              ; preds = %198
  br label %230

230:                                              ; preds = %229
  %231 = load i32, ptr %22, align 4, !tbaa !9
  %232 = add nsw i32 %231, -1
  store i32 %232, ptr %22, align 4, !tbaa !9
  br label %173, !llvm.loop !17

233:                                              ; preds = %173
  %234 = load ptr, ptr %8, align 8, !tbaa !5
  %235 = load i32, ptr %234, align 4, !tbaa !9
  %236 = sub nsw i32 %235, 1
  store i32 %236, ptr %17, align 4, !tbaa !9
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  %238 = getelementptr inbounds double, ptr %237, i64 1
  %239 = load ptr, ptr %10, align 8, !tbaa !5
  %240 = load ptr, ptr %13, align 8, !tbaa !5
  %241 = getelementptr inbounds i32, ptr %240, i64 1
  %242 = call i32 @dlaswp_(ptr noundef @c__1, ptr noundef %238, ptr noundef %239, ptr noundef @c__1, ptr noundef %17, ptr noundef %241, ptr noundef @c_n1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  ret void
}

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

declare double @dlamch_(ptr noundef) #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

declare void @dscal_(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !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"

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@c__1 = external hidden global i32, align 4
@c_n1 = external hidden global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local void @dgesc2_(ptr noundef %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr nocapture noundef %6) local_unnamed_addr #0 {
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %narrow = xor i32 %12, -1
  %13 = sext i32 %narrow to i64
  %14 = getelementptr inbounds double, ptr %1, i64 %13
  %15 = getelementptr inbounds i8, ptr %3, i64 -8
  %16 = tail call double @dlamch_(ptr noundef nonnull @.str) #5
  %17 = tail call double @dlamch_(ptr noundef nonnull @.str.1) #5
  %18 = fdiv double %17, %16
  store double %18, ptr %11, align 8, !tbaa !9
  %19 = fdiv double 1.000000e+00, %18
  store double %19, ptr %10, align 8, !tbaa !9
  call void @dlabad_(ptr noundef nonnull %11, ptr noundef nonnull %10) #5
  %20 = load i32, ptr %0, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr %8, align 4, !tbaa !5
  %22 = call i32 @dlaswp_(ptr noundef nonnull @c__1, ptr noundef %3, ptr noundef nonnull %2, ptr noundef nonnull @c__1, ptr noundef nonnull %8, ptr noundef %4, ptr noundef nonnull @c__1) #5
  %23 = load i32, ptr %0, align 4, !tbaa !5
  %24 = add nsw i32 %23, -1
  store i32 %24, ptr %8, align 4, !tbaa !5
  %.not.not81 = icmp sgt i32 %23, 1
  br i1 %.not.not81, label %.lr.ph83.preheader, label %._crit_edge

.lr.ph83.preheader:                               ; preds = %7
  %25 = add nuw i32 %23, 1
  %26 = sext i32 %12 to i64
  %wide.trip.count99 = zext nneg i32 %23 to i64
  %wide.trip.count = zext i32 %25 to i64
  %27 = shl nuw nsw i64 %wide.trip.count, 3
  %28 = getelementptr i8, ptr %3, i64 %27
  %scevgep110 = getelementptr i8, ptr %28, i64 -8
  %29 = shl nsw i64 %26, 3
  %30 = add nsw i64 %26, %13
  %31 = shl nsw i64 %30, 3
  %32 = add nsw i64 %29, 8
  %33 = shl nsw i64 %26, 3
  %34 = add nsw i64 %wide.trip.count, -2
  %35 = zext nneg i32 %23 to i64
  %36 = getelementptr i8, ptr %1, i64 %31
  %37 = getelementptr i8, ptr %36, i64 %27
  %38 = getelementptr i8, ptr %1, i64 %31
  %39 = getelementptr i8, ptr %38, i64 16
  %invariant.gep124 = getelementptr i8, ptr %3, i64 8
  br label %.lr.ph

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond100.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

.lr.ph:                                           ; preds = %.loopexit, %.lr.ph83.preheader
  %indvar = phi i64 [ %indvar.next, %.loopexit ], [ 0, %.lr.ph83.preheader ]
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.loopexit ], [ 1, %.lr.ph83.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit ], [ 2, %.lr.ph83.preheader ]
  %40 = sub i64 %34, %indvar
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %41 = mul nsw i64 %indvars.iv96, %26
  %42 = getelementptr inbounds double, ptr %15, i64 %indvars.iv96
  %invariant.gep = getelementptr double, ptr %14, i64 %41
  %min.iters.check = icmp ult i64 %40, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %43 = mul i64 %33, %indvar
  %scevgep112 = getelementptr i8, ptr %37, i64 %43
  %44 = mul i64 %32, %indvar
  %scevgep111 = getelementptr i8, ptr %39, i64 %44
  %45 = shl nuw nsw i64 %indvar, 3
  %gep125 = getelementptr i8, ptr %invariant.gep124, i64 %45
  %bound0 = icmp ult ptr %gep125, %scevgep112
  %bound1 = icmp ult ptr %scevgep111, %scevgep110
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %40, -4
  %ind.end = add i64 %indvars.iv, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %indvars.iv, %index
  %46 = getelementptr double, ptr %invariant.gep, i64 %offset.idx
  %47 = getelementptr i8, ptr %46, i64 16
  %wide.load = load <2 x double>, ptr %46, align 8, !tbaa !9, !alias.scope !13
  %wide.load113 = load <2 x double>, ptr %47, align 8, !tbaa !9, !alias.scope !13
  %48 = load double, ptr %42, align 8, !tbaa !9, !alias.scope !16
  %broadcast.splatinsert116 = insertelement <2 x double> poison, double %48, i64 0
  %broadcast.splat117 = shufflevector <2 x double> %broadcast.splatinsert116, <2 x double> poison, <2 x i32> zeroinitializer
  %49 = getelementptr inbounds double, ptr %15, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load114 = load <2 x double>, ptr %49, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %wide.load115 = load <2 x double>, ptr %50, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %51 = fneg <2 x double> %wide.load
  %52 = fneg <2 x double> %wide.load113
  %53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %broadcast.splat117, <2 x double> %wide.load114)
  %54 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> %broadcast.splat117, <2 x double> %wide.load115)
  store <2 x double> %53, ptr %49, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  store <2 x double> %54, ptr %50, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %index.next = add nuw i64 %index, 4
  %55 = icmp eq i64 %index.next, %n.vec
  br i1 %55, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %40, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %indvars.iv93.ph = phi i64 [ %indvars.iv, %vector.memcheck ], [ %indvars.iv, %.lr.ph ], [ %ind.end, %middle.block ]
  %56 = sub i64 %wide.trip.count, %indvars.iv93.ph
  %xtraiter = and i64 %56, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %gep.prol = getelementptr double, ptr %invariant.gep, i64 %indvars.iv93.ph
  %57 = load double, ptr %gep.prol, align 8, !tbaa !9
  %58 = load double, ptr %42, align 8, !tbaa !9
  %59 = getelementptr inbounds double, ptr %15, i64 %indvars.iv93.ph
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = fneg double %57
  %62 = call double @llvm.fmuladd.f64(double %61, double %58, double %60)
  store double %62, ptr %59, align 8, !tbaa !9
  %indvars.iv.next94.prol = add nuw nsw i64 %indvars.iv93.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv93.unr = phi i64 [ %indvars.iv93.ph, %scalar.ph.preheader ], [ %indvars.iv.next94.prol, %scalar.ph.prol ]
  %63 = icmp eq i64 %indvars.iv93.ph, %35
  br i1 %63, label %.loopexit, label %scalar.ph.preheader.new

scalar.ph.preheader.new:                          ; preds = %scalar.ph.prol.loopexit
  %invariant.gep122 = getelementptr i8, ptr %invariant.gep, i64 8
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph, %scalar.ph.preheader.new
  %indvars.iv93 = phi i64 [ %indvars.iv93.unr, %scalar.ph.preheader.new ], [ %indvars.iv.next94.1, %scalar.ph ]
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv93
  %64 = load double, ptr %gep, align 8, !tbaa !9
  %65 = load double, ptr %42, align 8, !tbaa !9
  %66 = getelementptr inbounds double, ptr %15, i64 %indvars.iv93
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fneg double %64
  %69 = call double @llvm.fmuladd.f64(double %68, double %65, double %67)
  store double %69, ptr %66, align 8, !tbaa !9
  %gep123 = getelementptr double, ptr %invariant.gep122, i64 %indvars.iv93
  %70 = load double, ptr %gep123, align 8, !tbaa !9
  %71 = load double, ptr %42, align 8, !tbaa !9
  %72 = getelementptr double, ptr %3, i64 %indvars.iv93
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = fneg double %70
  %75 = call double @llvm.fmuladd.f64(double %74, double %71, double %73)
  store double %75, ptr %72, align 8, !tbaa !9
  %indvars.iv.next94.1 = add nuw nsw i64 %indvars.iv93, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next94.1, %wide.trip.count
  br i1 %exitcond.not.1, label %.loopexit, label %scalar.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %.loopexit, %7
  store double 1.000000e+00, ptr %6, align 8, !tbaa !9
  %76 = call i32 @idamax_(ptr noundef nonnull %0, ptr noundef %3, ptr noundef nonnull @c__1) #5
  %77 = load double, ptr %11, align 8, !tbaa !9
  %78 = fmul double %77, 2.000000e+00
  %79 = sext i32 %76 to i64
  %80 = getelementptr inbounds double, ptr %15, i64 %79
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = fcmp oge double %81, 0.000000e+00
  %83 = fneg double %81
  %84 = select i1 %82, double %81, double %83
  %85 = fmul double %78, %84
  %86 = load i32, ptr %0, align 4, !tbaa !5
  %87 = add i32 %12, 1
  %88 = mul i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %14, i64 %89
  %91 = load double, ptr %90, align 8, !tbaa !9
  %92 = fcmp oge double %91, 0.000000e+00
  %93 = fneg double %91
  %94 = select i1 %92, double %91, double %93
  %95 = fcmp ogt double %85, %94
  br i1 %95, label %96, label %101

96:                                               ; preds = %._crit_edge
  %97 = fdiv double 5.000000e-01, %84
  store double %97, ptr %9, align 8, !tbaa !9
  call void @dscal_(ptr noundef nonnull %0, ptr noundef nonnull %9, ptr noundef nonnull %3, ptr noundef nonnull @c__1) #5
  %98 = load double, ptr %9, align 8, !tbaa !9
  %99 = load double, ptr %6, align 8, !tbaa !9
  %100 = fmul double %98, %99
  store double %100, ptr %6, align 8, !tbaa !9
  %.pre = load i32, ptr %0, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %96, %._crit_edge
  %102 = phi i32 [ %.pre, %96 ], [ %86, %._crit_edge ]
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.lr.ph91.preheader, label %139

.lr.ph91.preheader:                               ; preds = %101
  %104 = zext nneg i32 %102 to i64
  %105 = sext i32 %12 to i64
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %._crit_edge88
  %indvar118 = phi i32 [ 0, %.lr.ph91.preheader ], [ %indvar.next119, %._crit_edge88 ]
  %indvars.iv101 = phi i64 [ %104, %.lr.ph91.preheader ], [ %indvars.iv.next102, %._crit_edge88 ]
  %106 = trunc nuw nsw i64 %indvars.iv101 to i32
  %107 = mul i32 %87, %106
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %14, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !9
  %111 = fdiv double 1.000000e+00, %110
  %112 = getelementptr inbounds double, ptr %15, i64 %indvars.iv101
  %113 = load double, ptr %112, align 8, !tbaa !9
  %114 = fmul double %111, %113
  store double %114, ptr %112, align 8, !tbaa !9
  %.not77.not84 = icmp slt i64 %indvars.iv101, %104
  br i1 %.not77.not84, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %.lr.ph91
  %invariant.gep108 = getelementptr double, ptr %14, i64 %indvars.iv101
  %xtraiter120 = and i32 %indvar118, 1
  %lcmp.mod121.not = icmp eq i32 %xtraiter120, 0
  br i1 %lcmp.mod121.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph87
  %indvars.iv.next104.prol = add nsw i64 %indvars.iv101, 1
  %115 = getelementptr double, ptr %3, i64 %indvars.iv101
  %116 = load double, ptr %115, align 8, !tbaa !9
  %117 = mul nsw i64 %indvars.iv.next104.prol, %105
  %gep109.prol = getelementptr double, ptr %invariant.gep108, i64 %117
  %118 = load double, ptr %gep109.prol, align 8, !tbaa !9
  %119 = fmul double %111, %118
  %120 = fneg double %116
  %121 = call double @llvm.fmuladd.f64(double %120, double %119, double %114)
  store double %121, ptr %112, align 8, !tbaa !9
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph87
  %indvars.iv103.unr = phi i64 [ %indvars.iv101, %.lr.ph87 ], [ %indvars.iv.next104.prol, %.prol.loopexit.unr-lcssa ]
  %.unr = phi double [ %114, %.lr.ph87 ], [ %121, %.prol.loopexit.unr-lcssa ]
  %122 = icmp eq i32 %indvar118, 1
  br i1 %122, label %._crit_edge88, label %.lr.ph87.new

.lr.ph87.new:                                     ; preds = %.prol.loopexit, %.lr.ph87.new
  %indvars.iv103 = phi i64 [ %indvars.iv.next104.1, %.lr.ph87.new ], [ %indvars.iv103.unr, %.prol.loopexit ]
  %123 = phi double [ %137, %.lr.ph87.new ], [ %.unr, %.prol.loopexit ]
  %indvars.iv.next104 = add nsw i64 %indvars.iv103, 1
  %124 = getelementptr double, ptr %3, i64 %indvars.iv103
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = mul nsw i64 %indvars.iv.next104, %105
  %gep109 = getelementptr double, ptr %invariant.gep108, i64 %126
  %127 = load double, ptr %gep109, align 8, !tbaa !9
  %128 = fmul double %111, %127
  %129 = fneg double %125
  %130 = call double @llvm.fmuladd.f64(double %129, double %128, double %123)
  store double %130, ptr %112, align 8, !tbaa !9
  %indvars.iv.next104.1 = add nsw i64 %indvars.iv103, 2
  %131 = getelementptr double, ptr %3, i64 %indvars.iv.next104
  %132 = load double, ptr %131, align 8, !tbaa !9
  %133 = mul nsw i64 %indvars.iv.next104.1, %105
  %gep109.1 = getelementptr double, ptr %invariant.gep108, i64 %133
  %134 = load double, ptr %gep109.1, align 8, !tbaa !9
  %135 = fmul double %111, %134
  %136 = fneg double %132
  %137 = call double @llvm.fmuladd.f64(double %136, double %135, double %130)
  store double %137, ptr %112, align 8, !tbaa !9
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next104.1 to i32
  %exitcond106.not.1 = icmp eq i32 %102, %lftr.wideiv.1
  br i1 %exitcond106.not.1, label %._crit_edge88, label %.lr.ph87.new, !llvm.loop !24

._crit_edge88:                                    ; preds = %.prol.loopexit, %.lr.ph87.new, %.lr.ph91
  %indvars.iv.next102 = add nsw i64 %indvars.iv101, -1
  %138 = icmp sgt i64 %indvars.iv101, 1
  %indvar.next119 = add i32 %indvar118, 1
  br i1 %138, label %.lr.ph91, label %._crit_edge92, !llvm.loop !25

._crit_edge92:                                    ; preds = %._crit_edge88
  store double %111, ptr %9, align 8, !tbaa !9
  br label %139

139:                                              ; preds = %._crit_edge92, %101
  %140 = add nsw i32 %102, -1
  store i32 %140, ptr %8, align 4, !tbaa !5
  %141 = call i32 @dlaswp_(ptr noundef nonnull @c__1, ptr noundef nonnull %3, ptr noundef nonnull %2, ptr noundef nonnull @c__1, ptr noundef nonnull %8, ptr noundef %5, ptr noundef nonnull @c_n1) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #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 double @dlamch_(ptr noundef) local_unnamed_addr #2

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

declare i32 @dlaswp_(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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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"}
!13 = !{!14}
!14 = distinct !{!14, !15}
!15 = distinct !{!15, !"LVerDomain"}
!16 = !{!17}
!17 = distinct !{!17, !15}
!18 = !{!19}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !12, !21, !22}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !12, !21}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


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