; LLVM IR from lzyrapx/Competitive-Programming :: Retired_code/Guass/洛谷 P3389（高斯消元）.ll (Z5Gaussv)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [1234 x [1234 x double]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5Gaussv() #0 {
  %1 = alloca i1, align 1
  %2 = alloca i32, align 4
  %3 = alloca double, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %144, %0
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  store i32 2, ptr %5, align 4
  br label %147

17:                                               ; preds = %12
  %18 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %18, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %6, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %47, %17
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %50

26:                                               ; preds = %21
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %28
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1234 x double], ptr %29, i64 0, i64 %31
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = call double @llvm.fabs.f64(double %33)
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1234 x double], ptr %37, i64 0, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = call double @llvm.fabs.f64(double %41)
  %43 = fcmp ogt double %34, %42
  br i1 %43, label %44, label %46

44:                                               ; preds = %26
  %45 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %44, %26
  br label %47

47:                                               ; preds = %46
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %6, align 4, !tbaa !5
  br label %21, !llvm.loop !11

50:                                               ; preds = %25
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1234 x double], ptr %53, i64 0, i64 %55
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = call double @llvm.fabs.f64(double %57)
  %59 = fcmp olt double %58, 0x3E7AD7F29ABCAF48
  br i1 %59, label %60, label %61

60:                                               ; preds = %50
  store i1 false, ptr %1, align 1
  store i32 1, ptr %5, align 4
  br label %147

61:                                               ; preds = %50
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = icmp ne i32 %62, %63
  br i1 %64, label %65, label %88

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %84, %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %87

71:                                               ; preds = %66
  %72 = load i32, ptr %2, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %73
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1234 x double], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %79
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [1234 x double], ptr %80, i64 0, i64 %82
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef nonnull align 8 dereferenceable(8) %83) #4
  br label %84

84:                                               ; preds = %71
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %7, align 4, !tbaa !5
  br label %66, !llvm.loop !13

87:                                               ; preds = %70
  br label %88

88:                                               ; preds = %87, %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %140, %88
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = icmp slt i32 %92, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %91
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %143

96:                                               ; preds = %91
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1234 x double], ptr %99, i64 0, i64 %101
  %103 = load double, ptr %102, align 8, !tbaa !9
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %105
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1234 x double], ptr %106, i64 0, i64 %108
  %110 = load double, ptr %109, align 8, !tbaa !9
  %111 = fdiv double %103, %110
  store double %111, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %112 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %112, ptr %9, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %136, %96
  %114 = load i32, ptr %9, align 4, !tbaa !5
  %115 = load i32, ptr @n, align 4, !tbaa !5
  %116 = icmp sle i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %139

118:                                              ; preds = %113
  %119 = load double, ptr %3, align 8, !tbaa !9
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %121
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [1234 x double], ptr %122, i64 0, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %128
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [1234 x double], ptr %129, i64 0, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !9
  %134 = fneg double %119
  %135 = call double @llvm.fmuladd.f64(double %134, double %126, double %133)
  store double %135, ptr %132, align 8, !tbaa !9
  br label %136

136:                                              ; preds = %118
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %9, align 4, !tbaa !5
  br label %113, !llvm.loop !14

139:                                              ; preds = %117
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %8, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %8, align 4, !tbaa !5
  br label %91, !llvm.loop !15

143:                                              ; preds = %95
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %4, align 4, !tbaa !5
  br label %12, !llvm.loop !16

147:                                              ; preds = %60, %16
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %148 = load i32, ptr %5, align 4
  switch i32 %148, label %211 [
    i32 2, label %149
  ]

149:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %150 = load i32, ptr @n, align 4, !tbaa !5
  %151 = sub nsw i32 %150, 1
  store i32 %151, ptr %10, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %207, %149
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = icmp sge i32 %153, 0
  br i1 %154, label %156, label %155

155:                                              ; preds = %152
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %210

156:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %11, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %188, %156
  %160 = load i32, ptr %11, align 4, !tbaa !5
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %191

164:                                              ; preds = %159
  %165 = load i32, ptr %11, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %166
  %168 = load i32, ptr @n, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [1234 x double], ptr %167, i64 0, i64 %169
  %171 = load double, ptr %170, align 8, !tbaa !9
  %172 = load i32, ptr %10, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %173
  %175 = load i32, ptr %11, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [1234 x double], ptr %174, i64 0, i64 %176
  %178 = load double, ptr %177, align 8, !tbaa !9
  %179 = load i32, ptr %10, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %180
  %182 = load i32, ptr @n, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [1234 x double], ptr %181, i64 0, i64 %183
  %185 = load double, ptr %184, align 8, !tbaa !9
  %186 = fneg double %171
  %187 = call double @llvm.fmuladd.f64(double %186, double %178, double %185)
  store double %187, ptr %184, align 8, !tbaa !9
  br label %188

188:                                              ; preds = %164
  %189 = load i32, ptr %11, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %11, align 4, !tbaa !5
  br label %159, !llvm.loop !17

191:                                              ; preds = %163
  %192 = load i32, ptr %10, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %193
  %195 = load i32, ptr %10, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [1234 x double], ptr %194, i64 0, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !9
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %200
  %202 = load i32, ptr @n, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [1234 x double], ptr %201, i64 0, i64 %203
  %205 = load double, ptr %204, align 8, !tbaa !9
  %206 = fdiv double %205, %198
  store double %206, ptr %204, align 8, !tbaa !9
  br label %207

207:                                              ; preds = %191
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = add nsw i32 %208, -1
  store i32 %209, ptr %10, align 4, !tbaa !5
  br label %152, !llvm.loop !18

210:                                              ; preds = %155
  store i1 true, ptr %1, align 1
  store i32 1, ptr %5, align 4
  br label %211

211:                                              ; preds = %210, %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %212 = load i1, ptr %1, align 1
  ret i1 %212
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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

@n = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [1234 x [1234 x double]], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5Gaussv() local_unnamed_addr #0 {
  %1 = load i32, ptr @n, align 4
  %.not6384 = icmp slt i32 %1, 1
  br i1 %.not6384, label %.loopexit, label %.lr.ph88

.loopexit64:                                      ; preds = %._crit_edge80, %.loopexit66
  %2 = sext i32 %33 to i64
  %.not63.not = icmp slt i64 %indvars.iv.next109, %2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not63.not, label %.lr.ph88, label %.critedge.preheader, !llvm.loop !5

.critedge.preheader:                              ; preds = %.loopexit64
  %3 = icmp sgt i32 %33, 0
  br i1 %3, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.critedge.preheader
  %4 = zext nneg i32 %33 to i64
  %5 = zext nneg i32 %33 to i64
  br label %.preheader

.lr.ph88:                                         ; preds = %0, %.loopexit64
  %6 = phi i32 [ %33, %.loopexit64 ], [ %1, %0 ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.loopexit64 ], [ 0, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.loopexit64 ], [ 1, %0 ]
  %7 = mul nuw nsw i64 %indvars.iv108, 9880
  %gep = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 9872), i64 %7
  %8 = xor i64 %indvars.iv108, -1
  %scevgep137 = getelementptr i8, ptr @a, i64 %7
  %gep150 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 8), i64 %7
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %9 = sext i32 %6 to i64
  %10 = icmp slt i64 %indvars.iv.next109, %9
  %11 = trunc nuw nsw i64 %indvars.iv108 to i32
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph88
  %wide.trip.count = zext i32 %6 to i64
  br label %17

._crit_edge:                                      ; preds = %17, %.lr.ph88
  %.057.lcssa = phi i32 [ %11, %.lr.ph88 ], [ %.158, %17 ]
  %12 = sext i32 %.057.lcssa to i64
  %13 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %12, i64 %indvars.iv108
  %14 = load double, ptr %13, align 8, !tbaa !7
  %15 = tail call double @llvm.fabs.f64(double %14)
  %16 = fcmp olt double %15, 0x3E7AD7F29ABCAF48
  br i1 %16, label %.loopexit, label %27

17:                                               ; preds = %.lr.ph, %17
  %indvars.iv102 = phi i64 [ %indvars.iv, %.lr.ph ], [ %indvars.iv.next103, %17 ]
  %.05771 = phi i32 [ %11, %.lr.ph ], [ %.158, %17 ]
  %18 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv102, i64 %indvars.iv108
  %19 = load double, ptr %18, align 8, !tbaa !7
  %20 = tail call double @llvm.fabs.f64(double %19)
  %21 = sext i32 %.05771 to i64
  %22 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %21, i64 %indvars.iv108
  %23 = load double, ptr %22, align 8, !tbaa !7
  %24 = tail call double @llvm.fabs.f64(double %23)
  %25 = fcmp ogt double %20, %24
  %26 = trunc nuw nsw i64 %indvars.iv102 to i32
  %.158 = select i1 %25, i32 %26, i32 %.05771
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %17, !llvm.loop !11

27:                                               ; preds = %._crit_edge
  %28 = zext i32 %.057.lcssa to i64
  %.not = icmp eq i64 %indvars.iv108, %28
  %.not6173 = icmp slt i32 %6, 0
  %or.cond = or i1 %.not, %.not6173
  br i1 %or.cond, label %.loopexit66, label %.lr.ph75

.lr.ph75:                                         ; preds = %27, %.lr.ph75
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph75 ], [ 0, %27 ]
  %29 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %12, i64 %indvars.iv105
  %30 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv105
  tail call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #4
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %31 = load i32, ptr @n, align 4
  %32 = sext i32 %31 to i64
  %.not61.not = icmp slt i64 %indvars.iv105, %32
  br i1 %.not61.not, label %.lr.ph75, label %.loopexit66, !llvm.loop !12

.loopexit66:                                      ; preds = %.lr.ph75, %27
  %.pre-phi = phi i64 [ %9, %27 ], [ %32, %.lr.ph75 ]
  %33 = phi i32 [ %6, %27 ], [ %31, %.lr.ph75 ]
  %34 = icmp slt i64 %indvars.iv.next109, %.pre-phi
  br i1 %34, label %.lr.ph79.preheader, label %.loopexit64

.lr.ph79.preheader:                               ; preds = %.loopexit66
  %35 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv108
  %36 = add i32 %33, 1
  %wide.trip.count118 = zext i32 %33 to i64
  %wide.trip.count113 = zext i32 %36 to i64
  %reass.sub = sub nsw i64 %wide.trip.count118, %indvars.iv108
  %37 = mul i64 %reass.sub, 9872
  %38 = add nsw i64 %8, %wide.trip.count113
  %39 = shl nsw i64 %38, 3
  %gep151 = getelementptr i8, ptr getelementptr (i8, ptr @a, i64 -9864), i64 %7
  %40 = getelementptr i8, ptr %gep151, i64 %37
  %scevgep136 = getelementptr i8, ptr %40, i64 %39
  %scevgep139 = getelementptr i8, ptr %gep150, i64 %39
  %41 = sub nsw i64 %wide.trip.count113, %indvars.iv108
  %min.iters.check = icmp ult i64 %41, 4
  %bound0 = icmp ult ptr %gep, %scevgep139
  %bound1 = icmp ult ptr %scevgep137, %scevgep136
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %41, -4
  %ind.end = add i64 %indvars.iv108, %n.vec
  %cmp.n = icmp eq i64 %41, %n.vec
  %42 = add nsw i64 %wide.trip.count113, -1
  br label %.lr.ph79

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %._crit_edge80
  %indvars.iv115 = phi i64 [ %indvars.iv, %.lr.ph79.preheader ], [ %indvars.iv.next116, %._crit_edge80 ]
  %43 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv115, i64 %indvars.iv108
  %44 = load double, ptr %43, align 8, !tbaa !7
  %45 = load double, ptr %35, align 8, !tbaa !7
  %46 = fneg double %44
  %47 = fdiv double %46, %45
  %brmerge = select i1 %min.iters.check, i1 true, i1 %found.conflict
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %.lr.ph79, %middle.block
  %indvars.iv110.ph = phi i64 [ %indvars.iv108, %.lr.ph79 ], [ %ind.end, %middle.block ]
  %48 = sub i64 %wide.trip.count113, %indvars.iv110.ph
  %xtraiter = and i64 %48, 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
  %49 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv110.ph
  %50 = load double, ptr %49, align 8, !tbaa !7
  %51 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv115, i64 %indvars.iv110.ph
  %52 = load double, ptr %51, align 8, !tbaa !7
  %53 = tail call double @llvm.fmuladd.f64(double %47, double %50, double %52)
  store double %53, ptr %51, align 8, !tbaa !7
  %indvars.iv.next111.prol = add nuw nsw i64 %indvars.iv110.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv110.unr = phi i64 [ %indvars.iv110.ph, %scalar.ph.preheader ], [ %indvars.iv.next111.prol, %scalar.ph.prol ]
  %54 = icmp eq i64 %indvars.iv110.ph, %42
  br i1 %54, label %._crit_edge80, label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph79
  %broadcast.splatinsert = insertelement <2 x double> poison, double %47, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  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.iv108, %index
  %55 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %offset.idx
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %wide.load = load <2 x double>, ptr %55, align 8, !tbaa !7, !alias.scope !13
  %wide.load140 = load <2 x double>, ptr %56, align 8, !tbaa !7, !alias.scope !13
  %57 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv115, i64 %offset.idx
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  %wide.load141 = load <2 x double>, ptr %57, align 8, !tbaa !7, !alias.scope !16, !noalias !13
  %wide.load142 = load <2 x double>, ptr %58, align 8, !tbaa !7, !alias.scope !16, !noalias !13
  %59 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load, <2 x double> %wide.load141)
  %60 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat, <2 x double> %wide.load140, <2 x double> %wide.load142)
  store <2 x double> %59, ptr %57, align 8, !tbaa !7, !alias.scope !16, !noalias !13
  store <2 x double> %60, ptr %58, align 8, !tbaa !7, !alias.scope !16, !noalias !13
  %index.next = add nuw i64 %index, 4
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge80, label %scalar.ph.preheader

._crit_edge80:                                    ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %.loopexit64, label %.lr.ph79, !llvm.loop !21

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv110 = phi i64 [ %indvars.iv.next111.1, %scalar.ph ], [ %indvars.iv110.unr, %scalar.ph.prol.loopexit ]
  %62 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv110
  %63 = load double, ptr %62, align 8, !tbaa !7
  %64 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv115, i64 %indvars.iv110
  %65 = load double, ptr %64, align 8, !tbaa !7
  %66 = tail call double @llvm.fmuladd.f64(double %47, double %63, double %65)
  store double %66, ptr %64, align 8, !tbaa !7
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %67 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv.next111
  %68 = load double, ptr %67, align 8, !tbaa !7
  %69 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv115, i64 %indvars.iv.next111
  %70 = load double, ptr %69, align 8, !tbaa !7
  %71 = tail call double @llvm.fmuladd.f64(double %47, double %68, double %70)
  store double %71, ptr %69, align 8, !tbaa !7
  %indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2
  %exitcond114.not.1 = icmp eq i64 %indvars.iv.next111.1, %wide.trip.count113
  br i1 %exitcond114.not.1, label %._crit_edge80, label %scalar.ph, !llvm.loop !22

.preheader:                                       ; preds = %.preheader.lr.ph, %.critedge
  %indvars.iv120 = phi i64 [ %4, %.preheader.lr.ph ], [ %indvars.iv.next121, %.critedge ]
  %indvars.iv.next121 = add nsw i64 %indvars.iv120, -1
  %72 = icmp slt i64 %indvars.iv120, %5
  %73 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv.next121, i64 %4
  %.promoted = load double, ptr %73, align 8, !tbaa !7
  br i1 %72, label %.lr.ph92, label %.critedge

.critedge:                                        ; preds = %.lr.ph92, %.preheader
  %74 = phi double [ %.promoted, %.preheader ], [ %86, %.lr.ph92 ]
  %75 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv.next121, i64 %indvars.iv.next121
  %76 = load double, ptr %75, align 8, !tbaa !7
  %77 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv.next121, i64 %4
  %78 = fdiv double %74, %76
  store double %78, ptr %77, align 8, !tbaa !7
  %79 = icmp sgt i64 %indvars.iv120, 1
  br i1 %79, label %.preheader, label %.loopexit, !llvm.loop !23

.lr.ph92:                                         ; preds = %.preheader, %.lr.ph92
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.lr.ph92 ], [ %indvars.iv120, %.preheader ]
  %80 = phi double [ %86, %.lr.ph92 ], [ %.promoted, %.preheader ]
  %81 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv122, i64 %4
  %82 = load double, ptr %81, align 8, !tbaa !7
  %83 = getelementptr inbounds [1234 x [1234 x double]], ptr @a, i64 0, i64 %indvars.iv.next121, i64 %indvars.iv122
  %84 = load double, ptr %83, align 8, !tbaa !7
  %85 = fneg double %82
  %86 = tail call double @llvm.fmuladd.f64(double %85, double %84, double %80)
  store double %86, ptr %73, align 8, !tbaa !7
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %87 = trunc nuw i64 %indvars.iv.next123 to i32
  %88 = icmp sgt i32 %33, %87
  br i1 %88, label %.lr.ph92, label %.critedge, !llvm.loop !24

.loopexit:                                        ; preds = %._crit_edge, %.critedge, %0, %.critedge.preheader
  %.not6369 = phi i1 [ true, %.critedge.preheader ], [ true, %0 ], [ true, %.critedge ], [ false, %._crit_edge ]
  ret i1 %.not6369
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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>) #3

attributes #0 = { mustprogress 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 speculatable willreturn memory(none) }
attributes #2 = { inlinehint mustprogress 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{!14}
!14 = distinct !{!14, !15}
!15 = distinct !{!15, !"LVerDomain"}
!16 = !{!17}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6, !19}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}


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