; LLVM IR from niuyishuai/PDCABB :: LAPACK_BLAS/LAPACK (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 i64, align 8
@c_n1 = external hidden global i64, align 8

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

60:                                               ; preds = %96, %7
  %61 = load i64, ptr %21, align 8, !tbaa !9
  %62 = load i64, ptr %17, align 8, !tbaa !9
  %63 = icmp sle i64 %61, %62
  br i1 %63, label %64, label %99

64:                                               ; preds = %60
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load i64, ptr %65, align 8, !tbaa !9
  store i64 %66, ptr %18, align 8, !tbaa !9
  %67 = load i64, ptr %21, align 8, !tbaa !9
  %68 = add nsw i64 %67, 1
  store i64 %68, ptr %22, align 8, !tbaa !9
  br label %69

69:                                               ; preds = %92, %64
  %70 = load i64, ptr %22, align 8, !tbaa !9
  %71 = load i64, ptr %18, align 8, !tbaa !9
  %72 = icmp sle i64 %70, %71
  br i1 %72, label %73, label %95

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

92:                                               ; preds = %73
  %93 = load i64, ptr %22, align 8, !tbaa !9
  %94 = add nsw i64 %93, 1
  store i64 %94, ptr %22, align 8, !tbaa !9
  br label %69, !llvm.loop !13

95:                                               ; preds = %69
  br label %96

96:                                               ; preds = %95
  %97 = load i64, ptr %21, align 8, !tbaa !9
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %21, align 8, !tbaa !9
  br label %60, !llvm.loop !15

99:                                               ; preds = %60
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  store double 1.000000e+00, ptr %100, align 8, !tbaa !11
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = getelementptr inbounds double, ptr %102, i64 1
  %104 = call i64 @f2c_idamax(ptr noundef %101, ptr noundef %103, ptr noundef @c__1)
  store i64 %104, ptr %21, align 8, !tbaa !9
  %105 = load double, ptr %26, align 8, !tbaa !11
  %106 = fmul double %105, 2.000000e+00
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load i64, ptr %21, align 8, !tbaa !9
  %109 = getelementptr inbounds double, ptr %107, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !11
  store double %110, ptr %19, align 8, !tbaa !11
  %111 = load double, ptr %19, align 8, !tbaa !11
  %112 = fcmp oge double %111, 0.000000e+00
  br i1 %112, label %113, label %115

113:                                              ; preds = %99
  %114 = load double, ptr %19, align 8, !tbaa !11
  br label %118

115:                                              ; preds = %99
  %116 = load double, ptr %19, align 8, !tbaa !11
  %117 = fneg double %116
  br label %118

118:                                              ; preds = %115, %113
  %119 = phi double [ %114, %113 ], [ %117, %115 ]
  %120 = fmul double %106, %119
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = load i64, ptr %15, align 8, !tbaa !9
  %127 = mul nsw i64 %125, %126
  %128 = add nsw i64 %123, %127
  %129 = getelementptr inbounds double, ptr %121, i64 %128
  %130 = load double, ptr %129, align 8, !tbaa !11
  store double %130, ptr %20, align 8, !tbaa !11
  %131 = load double, ptr %20, align 8, !tbaa !11
  %132 = fcmp oge double %131, 0.000000e+00
  br i1 %132, label %133, label %135

133:                                              ; preds = %118
  %134 = load double, ptr %20, align 8, !tbaa !11
  br label %138

135:                                              ; preds = %118
  %136 = load double, ptr %20, align 8, !tbaa !11
  %137 = fneg double %136
  br label %138

138:                                              ; preds = %135, %133
  %139 = phi double [ %134, %133 ], [ %137, %135 ]
  %140 = fcmp ogt double %120, %139
  br i1 %140, label %141, label %164

141:                                              ; preds = %138
  %142 = load ptr, ptr %11, align 8, !tbaa !5
  %143 = load i64, ptr %21, align 8, !tbaa !9
  %144 = getelementptr inbounds double, ptr %142, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !11
  store double %145, ptr %19, align 8, !tbaa !11
  %146 = load double, ptr %19, align 8, !tbaa !11
  %147 = fcmp oge double %146, 0.000000e+00
  br i1 %147, label %148, label %150

148:                                              ; preds = %141
  %149 = load double, ptr %19, align 8, !tbaa !11
  br label %153

150:                                              ; preds = %141
  %151 = load double, ptr %19, align 8, !tbaa !11
  %152 = fneg double %151
  br label %153

153:                                              ; preds = %150, %148
  %154 = phi double [ %149, %148 ], [ %152, %150 ]
  %155 = fdiv double 5.000000e-01, %154
  store double %155, ptr %24, align 8, !tbaa !11
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = load ptr, ptr %11, align 8, !tbaa !5
  %158 = getelementptr inbounds double, ptr %157, i64 1
  %159 = call i32 @f2c_dscal(ptr noundef %156, ptr noundef %24, ptr noundef %158, ptr noundef @c__1)
  %160 = load double, ptr %24, align 8, !tbaa !11
  %161 = load ptr, ptr %14, align 8, !tbaa !5
  %162 = load double, ptr %161, align 8, !tbaa !11
  %163 = fmul double %162, %160
  store double %163, ptr %161, align 8, !tbaa !11
  br label %164

164:                                              ; preds = %153, %138
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = load i64, ptr %165, align 8, !tbaa !9
  store i64 %166, ptr %21, align 8, !tbaa !9
  br label %167

167:                                              ; preds = %219, %164
  %168 = load i64, ptr %21, align 8, !tbaa !9
  %169 = icmp sge i64 %168, 1
  br i1 %169, label %170, label %222

170:                                              ; preds = %167
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = load i64, ptr %21, align 8, !tbaa !9
  %173 = load i64, ptr %21, align 8, !tbaa !9
  %174 = load i64, ptr %15, align 8, !tbaa !9
  %175 = mul nsw i64 %173, %174
  %176 = add nsw i64 %172, %175
  %177 = getelementptr inbounds double, ptr %171, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !11
  %179 = fdiv double 1.000000e+00, %178
  store double %179, ptr %24, align 8, !tbaa !11
  %180 = load double, ptr %24, align 8, !tbaa !11
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = load i64, ptr %21, align 8, !tbaa !9
  %183 = getelementptr inbounds double, ptr %181, i64 %182
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = fmul double %184, %180
  store double %185, ptr %183, align 8, !tbaa !11
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  %187 = load i64, ptr %186, align 8, !tbaa !9
  store i64 %187, ptr %17, align 8, !tbaa !9
  %188 = load i64, ptr %21, align 8, !tbaa !9
  %189 = add nsw i64 %188, 1
  store i64 %189, ptr %22, align 8, !tbaa !9
  br label %190

190:                                              ; preds = %215, %170
  %191 = load i64, ptr %22, align 8, !tbaa !9
  %192 = load i64, ptr %17, align 8, !tbaa !9
  %193 = icmp sle i64 %191, %192
  br i1 %193, label %194, label %218

194:                                              ; preds = %190
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  %196 = load i64, ptr %22, align 8, !tbaa !9
  %197 = getelementptr inbounds double, ptr %195, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !11
  %199 = load ptr, ptr %9, align 8, !tbaa !5
  %200 = load i64, ptr %21, align 8, !tbaa !9
  %201 = load i64, ptr %22, align 8, !tbaa !9
  %202 = load i64, ptr %15, align 8, !tbaa !9
  %203 = mul nsw i64 %201, %202
  %204 = add nsw i64 %200, %203
  %205 = getelementptr inbounds double, ptr %199, i64 %204
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load double, ptr %24, align 8, !tbaa !11
  %208 = fmul double %206, %207
  %209 = load ptr, ptr %11, align 8, !tbaa !5
  %210 = load i64, ptr %21, align 8, !tbaa !9
  %211 = getelementptr inbounds double, ptr %209, i64 %210
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = fneg double %198
  %214 = call double @llvm.fmuladd.f64(double %213, double %208, double %212)
  store double %214, ptr %211, align 8, !tbaa !11
  br label %215

215:                                              ; preds = %194
  %216 = load i64, ptr %22, align 8, !tbaa !9
  %217 = add nsw i64 %216, 1
  store i64 %217, ptr %22, align 8, !tbaa !9
  br label %190, !llvm.loop !16

218:                                              ; preds = %190
  br label %219

219:                                              ; preds = %218
  %220 = load i64, ptr %21, align 8, !tbaa !9
  %221 = add nsw i64 %220, -1
  store i64 %221, ptr %21, align 8, !tbaa !9
  br label %167, !llvm.loop !17

222:                                              ; preds = %167
  %223 = load ptr, ptr %8, align 8, !tbaa !5
  %224 = load i64, ptr %223, align 8, !tbaa !9
  %225 = sub nsw i64 %224, 1
  store i64 %225, ptr %17, align 8, !tbaa !9
  %226 = load ptr, ptr %11, align 8, !tbaa !5
  %227 = getelementptr inbounds double, ptr %226, i64 1
  %228 = load ptr, ptr %10, align 8, !tbaa !5
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds i64, ptr %229, i64 1
  %231 = call i32 @dlaswp_(ptr noundef @c__1, ptr noundef %227, ptr noundef %228, ptr noundef @c__1, ptr noundef %17, ptr noundef %230, 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 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret i32 0
}

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

declare i32 @f2c_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 = !{!"long", !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 i64, align 8
@c_n1 = external hidden global i64, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @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 i64, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, 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 i64, ptr %2, align 8, !tbaa !5
  %13 = xor i64 %12, -1
  %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
  %20 = call i32 @dlabad_(ptr noundef nonnull %11, ptr noundef nonnull %10) #5
  %21 = load i64, ptr %0, align 8, !tbaa !5
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr %8, align 8, !tbaa !5
  %23 = 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
  %24 = load i64, ptr %0, align 8, !tbaa !5
  %25 = add nsw i64 %24, -1
  store i64 %25, ptr %8, align 8, !tbaa !5
  %.not.not81 = icmp sgt i64 %24, 1
  br i1 %.not.not81, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %7
  %26 = shl i64 %12, 3
  %27 = add i64 %26, 8
  %invariant.gep107 = getelementptr i8, ptr %1, i64 8
  %invariant.gep109 = getelementptr i8, ptr %3, i64 8
  br label %.lr.ph

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %exitcond.not = icmp eq i64 %31, %24
  %indvar.next = add i64 %indvar, 1
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.loopexit
  %indvar = phi i64 [ 0, %.lr.ph.preheader ], [ %indvar.next, %.loopexit ]
  %.07582 = phi i64 [ 1, %.lr.ph.preheader ], [ %31, %.loopexit ]
  %28 = add i64 %indvar, 2
  %smax99 = call i64 @llvm.smax.i64(i64 %24, i64 %28)
  %29 = xor i64 %indvar, -1
  %30 = add i64 %smax99, %29
  %31 = add nuw nsw i64 %.07582, 1
  %32 = mul nsw i64 %.07582, %12
  %invariant.gep = getelementptr double, ptr %14, i64 %32
  %33 = getelementptr inbounds double, ptr %15, i64 %.07582
  %min.iters.check = icmp ult i64 %30, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph
  %34 = add i64 %indvar, 2
  %smax = call i64 @llvm.smax.i64(i64 %24, i64 %34)
  %reass.sub = sub i64 %smax, %indvar
  %35 = shl i64 %reass.sub, 3
  %36 = mul i64 %27, %indvar
  %37 = getelementptr i8, ptr %1, i64 %36
  %scevgep98 = getelementptr i8, ptr %37, i64 %35
  %gep108 = getelementptr i8, ptr %invariant.gep107, i64 %36
  %38 = shl i64 %indvar, 3
  %39 = getelementptr i8, ptr %3, i64 %38
  %scevgep95 = getelementptr i8, ptr %39, i64 %35
  %gep110 = getelementptr i8, ptr %invariant.gep109, i64 %38
  %bound0 = icmp ult ptr %gep110, %scevgep98
  %bound1 = icmp ult ptr %gep108, %scevgep95
  %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 %30, -4
  %ind.end = add i64 %31, %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 %31, %index
  %40 = getelementptr double, ptr %invariant.gep, i64 %offset.idx
  %41 = getelementptr i8, ptr %40, i64 16
  %wide.load = load <2 x double>, ptr %40, align 8, !tbaa !9, !alias.scope !13
  %wide.load100 = load <2 x double>, ptr %41, align 8, !tbaa !9, !alias.scope !13
  %42 = load double, ptr %33, align 8, !tbaa !9, !alias.scope !16
  %broadcast.splatinsert103 = insertelement <2 x double> poison, double %42, i64 0
  %broadcast.splat104 = shufflevector <2 x double> %broadcast.splatinsert103, <2 x double> poison, <2 x i32> zeroinitializer
  %43 = getelementptr inbounds double, ptr %15, i64 %offset.idx
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load101 = load <2 x double>, ptr %43, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %wide.load102 = load <2 x double>, ptr %44, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %45 = fneg <2 x double> %wide.load
  %46 = fneg <2 x double> %wide.load100
  %47 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %45, <2 x double> %broadcast.splat104, <2 x double> %wide.load101)
  %48 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %46, <2 x double> %broadcast.splat104, <2 x double> %wide.load102)
  store <2 x double> %47, ptr %43, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  store <2 x double> %48, ptr %44, align 8, !tbaa !9, !alias.scope !18, !noalias !13
  %index.next = add nuw i64 %index, 4
  %49 = icmp eq i64 %index.next, %n.vec
  br i1 %49, label %middle.block, label %vector.body, !llvm.loop !20

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

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph
  %.080.ph = phi i64 [ %31, %vector.memcheck ], [ %31, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %.080 = phi i64 [ %56, %scalar.ph ], [ %.080.ph, %scalar.ph.preheader ]
  %gep = getelementptr double, ptr %invariant.gep, i64 %.080
  %50 = load double, ptr %gep, align 8, !tbaa !9
  %51 = load double, ptr %33, align 8, !tbaa !9
  %52 = getelementptr inbounds double, ptr %15, i64 %.080
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = fneg double %50
  %55 = call double @llvm.fmuladd.f64(double %54, double %51, double %53)
  store double %55, ptr %52, align 8, !tbaa !9
  %56 = add nuw nsw i64 %.080, 1
  %.not78.not = icmp slt i64 %.080, %24
  br i1 %.not78.not, label %scalar.ph, label %.loopexit, !llvm.loop !23

._crit_edge:                                      ; preds = %.loopexit, %7
  store double 1.000000e+00, ptr %6, align 8, !tbaa !9
  %57 = call i64 @f2c_idamax(ptr noundef nonnull %0, ptr noundef %3, ptr noundef nonnull @c__1) #5
  %58 = load double, ptr %11, align 8, !tbaa !9
  %59 = fmul double %58, 2.000000e+00
  %60 = getelementptr inbounds double, ptr %15, i64 %57
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fcmp oge double %61, 0.000000e+00
  %63 = fneg double %61
  %64 = select i1 %62, double %61, double %63
  %65 = fmul double %59, %64
  %66 = load i64, ptr %0, align 8, !tbaa !5
  %67 = add i64 %12, 1
  %68 = mul i64 %66, %67
  %69 = getelementptr inbounds double, ptr %14, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = fcmp oge double %70, 0.000000e+00
  %72 = fneg double %70
  %73 = select i1 %71, double %70, double %72
  %74 = fcmp ogt double %65, %73
  br i1 %74, label %75, label %81

75:                                               ; preds = %._crit_edge
  %76 = fdiv double 5.000000e-01, %64
  store double %76, ptr %9, align 8, !tbaa !9
  %77 = call i32 @f2c_dscal(ptr noundef nonnull %0, ptr noundef nonnull %9, ptr noundef nonnull %3, ptr noundef nonnull @c__1) #5
  %78 = load double, ptr %9, align 8, !tbaa !9
  %79 = load double, ptr %6, align 8, !tbaa !9
  %80 = fmul double %78, %79
  store double %80, ptr %6, align 8, !tbaa !9
  %.pre = load i64, ptr %0, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %75, %._crit_edge
  %82 = phi i64 [ %.pre, %75 ], [ %66, %._crit_edge ]
  %83 = icmp sgt i64 %82, 0
  br i1 %83, label %.lr.ph91, label %120

.lr.ph91:                                         ; preds = %81, %._crit_edge88
  %indvar105 = phi i64 [ %indvar.next106, %._crit_edge88 ], [ 0, %81 ]
  %.17689 = phi i64 [ %118, %._crit_edge88 ], [ %82, %81 ]
  %84 = mul i64 %.17689, %67
  %85 = getelementptr inbounds double, ptr %14, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fdiv double 1.000000e+00, %86
  %88 = getelementptr inbounds double, ptr %15, i64 %.17689
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = fmul double %87, %89
  store double %90, ptr %88, align 8, !tbaa !9
  %.not77.not84 = icmp slt i64 %.17689, %82
  br i1 %.not77.not84, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %.lr.ph91
  %91 = getelementptr double, ptr %14, i64 %.17689
  %xtraiter = and i64 %indvar105, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph87
  %.1.prol = add nuw nsw i64 %.17689, 1
  %92 = getelementptr double, ptr %3, i64 %.17689
  %93 = load double, ptr %92, align 8, !tbaa !9
  %94 = mul nsw i64 %.1.prol, %12
  %95 = getelementptr double, ptr %91, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !9
  %97 = fmul double %87, %96
  %98 = fneg double %93
  %99 = call double @llvm.fmuladd.f64(double %98, double %97, double %90)
  store double %99, ptr %88, align 8, !tbaa !9
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph87
  %.unr = phi double [ %90, %.lr.ph87 ], [ %99, %.prol.loopexit.unr-lcssa ]
  %.1.in85.unr = phi i64 [ %.17689, %.lr.ph87 ], [ %.1.prol, %.prol.loopexit.unr-lcssa ]
  %100 = icmp eq i64 %indvar105, 1
  br i1 %100, label %._crit_edge88, label %.lr.ph87.new

.lr.ph87.new:                                     ; preds = %.prol.loopexit, %.lr.ph87.new
  %101 = phi double [ %117, %.lr.ph87.new ], [ %.unr, %.prol.loopexit ]
  %.1.in85 = phi i64 [ %.1.1, %.lr.ph87.new ], [ %.1.in85.unr, %.prol.loopexit ]
  %.1 = add nuw nsw i64 %.1.in85, 1
  %102 = getelementptr double, ptr %3, i64 %.1.in85
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = mul nsw i64 %.1, %12
  %105 = getelementptr double, ptr %91, i64 %104
  %106 = load double, ptr %105, align 8, !tbaa !9
  %107 = fmul double %87, %106
  %108 = fneg double %103
  %109 = call double @llvm.fmuladd.f64(double %108, double %107, double %101)
  store double %109, ptr %88, align 8, !tbaa !9
  %.1.1 = add nuw nsw i64 %.1.in85, 2
  %110 = getelementptr double, ptr %3, i64 %.1
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = mul nsw i64 %.1.1, %12
  %113 = getelementptr double, ptr %91, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = fmul double %87, %114
  %116 = fneg double %111
  %117 = call double @llvm.fmuladd.f64(double %116, double %115, double %109)
  store double %117, ptr %88, align 8, !tbaa !9
  %exitcond93.not.1 = icmp eq i64 %.1.1, %82
  br i1 %exitcond93.not.1, label %._crit_edge88, label %.lr.ph87.new, !llvm.loop !24

._crit_edge88:                                    ; preds = %.prol.loopexit, %.lr.ph87.new, %.lr.ph91
  %118 = add nsw i64 %.17689, -1
  %119 = icmp sgt i64 %.17689, 1
  %indvar.next106 = add i64 %indvar105, 1
  br i1 %119, label %.lr.ph91, label %._crit_edge92, !llvm.loop !25

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

120:                                              ; preds = %._crit_edge92, %81
  %121 = add nsw i64 %82, -1
  store i64 %121, ptr %8, align 8, !tbaa !5
  %122 = 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 8, ptr nonnull %8) #5
  ret i32 0
}

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

declare double @dlamch_(ptr noundef) local_unnamed_addr #2

declare i32 @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 i64 @f2c_idamax(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @f2c_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 i64 @llvm.smax.i64(i64, i64) #4

; 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!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