; LLVM IR from Amoiensis/Optimization-Algorithm :: [Direct_Method]直接法/[Univariate_Search_Method]坐标轮换法 (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._Matrix = type { i32, i32, ptr }
%struct._Elementary_Transformation = type { i32, i32, double, ptr, ptr }

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

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

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

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

11:                                               ; preds = %3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._Matrix, ptr %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %14, ptr %7, align 4, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._Elementary_Transformation, ptr %15, i32 0, i32 2
  %17 = load double, ptr %16, align 8, !tbaa !13
  %18 = fcmp une double %17, 0.000000e+00
  br i1 %18, label %19, label %66

19:                                               ; preds = %11
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %62, %19
  %21 = load i32, ptr %8, align 4, !tbaa !9
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %65

24:                                               ; preds = %20
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._Elementary_Transformation, ptr %25, i32 0, i32 2
  %27 = load double, ptr %26, align 8, !tbaa !13
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._Matrix, ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct._Elementary_Transformation, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !17
  %34 = sub nsw i32 %33, 1
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct._Matrix, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = mul nsw i32 %34, %37
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = add nsw i32 %38, %39
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds double, ptr %30, i64 %41
  %43 = load double, ptr %42, align 8, !tbaa !18
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._Matrix, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._Elementary_Transformation, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !19
  %50 = sub nsw i32 %49, 1
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._Matrix, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !11
  %54 = mul nsw i32 %50, %53
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = add nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds double, ptr %46, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !18
  %60 = fneg double %27
  %61 = call double @llvm.fmuladd.f64(double %60, double %43, double %59)
  store double %61, ptr %58, align 8, !tbaa !18
  br label %62

62:                                               ; preds = %24
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !9
  br label %20, !llvm.loop !20

65:                                               ; preds = %20
  br label %89

66:                                               ; preds = %11
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._Elementary_Transformation, ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !19
  %70 = icmp slt i32 %69, 0
  br i1 %70, label %71, label %88

71:                                               ; preds = %66
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._Elementary_Transformation, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !17
  %75 = icmp slt i32 %74, 0
  br i1 %75, label %76, label %88

76:                                               ; preds = %71
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._Elementary_Transformation, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !19
  %81 = sub nsw i32 0, %80
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._Elementary_Transformation, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !17
  %85 = sub nsw i32 0, %84
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = call i32 @M_Swap(ptr noundef %77, i32 noundef %81, i32 noundef %85, i32 noundef %86)
  br label %88

88:                                               ; preds = %76, %71, %66
  br label %89

89:                                               ; preds = %88, %65
  br label %169

90:                                               ; preds = %3
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._Matrix, ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !22
  store i32 %93, ptr %7, align 4, !tbaa !9
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct._Elementary_Transformation, ptr %94, i32 0, i32 2
  %96 = load double, ptr %95, align 8, !tbaa !13
  %97 = fcmp une double %96, 0.000000e+00
  br i1 %97, label %98, label %145

98:                                               ; preds = %90
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %141, %98
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %103, label %144

103:                                              ; preds = %99
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._Elementary_Transformation, ptr %104, i32 0, i32 2
  %106 = load double, ptr %105, align 8, !tbaa !13
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._Matrix, ptr %107, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !16
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct._Elementary_Transformation, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !17
  %113 = sub nsw i32 %112, 1
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._Matrix, ptr %114, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = mul nsw i32 %116, %117
  %119 = add nsw i32 %113, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %109, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !18
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._Matrix, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !16
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._Elementary_Transformation, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !19
  %129 = sub nsw i32 %128, 1
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct._Matrix, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !11
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = mul nsw i32 %132, %133
  %135 = add nsw i32 %129, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %125, i64 %136
  %138 = load double, ptr %137, align 8, !tbaa !18
  %139 = fneg double %106
  %140 = call double @llvm.fmuladd.f64(double %139, double %122, double %138)
  store double %140, ptr %137, align 8, !tbaa !18
  br label %141

141:                                              ; preds = %103
  %142 = load i32, ptr %8, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %8, align 4, !tbaa !9
  br label %99, !llvm.loop !23

144:                                              ; preds = %99
  br label %168

145:                                              ; preds = %90
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._Elementary_Transformation, ptr %146, i32 0, i32 0
  %148 = load i32, ptr %147, align 8, !tbaa !19
  %149 = icmp slt i32 %148, 0
  br i1 %149, label %150, label %167

150:                                              ; preds = %145
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._Elementary_Transformation, ptr %151, i32 0, i32 1
  %153 = load i32, ptr %152, align 4, !tbaa !17
  %154 = icmp slt i32 %153, 0
  br i1 %154, label %155, label %167

155:                                              ; preds = %150
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct._Elementary_Transformation, ptr %157, i32 0, i32 0
  %159 = load i32, ptr %158, align 8, !tbaa !19
  %160 = sub nsw i32 0, %159
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._Elementary_Transformation, ptr %161, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !17
  %164 = sub nsw i32 0, %163
  %165 = load i32, ptr %6, align 4, !tbaa !9
  %166 = call i32 @M_Swap(ptr noundef %156, i32 noundef %160, i32 noundef %164, i32 noundef %165)
  br label %167

167:                                              ; preds = %155, %150, %145
  br label %168

168:                                              ; preds = %167, %144
  br label %169

169:                                              ; preds = %168, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @M_Swap(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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, !10, i64 4}
!12 = !{!"_Matrix", !10, i64 0, !10, i64 4, !6, i64 8}
!13 = !{!14, !15, i64 8}
!14 = !{!"_Elementary_Transformation", !10, i64 0, !10, i64 4, !15, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"double", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!14, !10, i64 4}
!18 = !{!15, !15, i64 0}
!19 = !{!14, !10, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 0}
!23 = distinct !{!23, !21}


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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @M_E_trans(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = icmp eq i32 %2, 1
  br i1 %4, label %5, label %61

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 4
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load double, ptr %8, align 8, !tbaa !11
  %10 = fcmp une double %9, 0.000000e+00
  br i1 %10, label %.preheader, label %54

.preheader:                                       ; preds = %5
  %11 = icmp sgt i32 %7, 0
  br i1 %11, label %.lr.ph50, label %.loopexit

.lr.ph50:                                         ; preds = %.preheader
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %1, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !15
  %16 = add nsw i32 %15, -1
  %17 = mul nsw i32 %16, %7
  %18 = load i32, ptr %1, align 8, !tbaa !16
  %19 = add nsw i32 %18, -1
  %20 = mul nsw i32 %19, %7
  %21 = sext i32 %17 to i64
  %22 = sext i32 %20 to i64
  %wide.trip.count56 = zext nneg i32 %7 to i64
  %invariant.gep = getelementptr double, ptr %13, i64 %21
  %invariant.gep59 = getelementptr double, ptr %13, i64 %22
  %min.iters.check91 = icmp ult i32 %7, 12
  br i1 %min.iters.check91, label %scalar.ph90.preheader, label %vector.memcheck78

vector.memcheck78:                                ; preds = %.lr.ph50
  %23 = add nsw i64 %22, %wide.trip.count56
  %24 = shl nsw i64 %23, 3
  %scevgep79 = getelementptr i8, ptr %13, i64 %24
  %scevgep80 = getelementptr i8, ptr %1, i64 16
  %25 = add nsw i64 %21, %wide.trip.count56
  %26 = shl nsw i64 %25, 3
  %scevgep81 = getelementptr i8, ptr %13, i64 %26
  %bound082 = icmp ult ptr %invariant.gep59, %scevgep80
  %bound183 = icmp ult ptr %8, %scevgep79
  %found.conflict84 = and i1 %bound082, %bound183
  %bound085 = icmp ult ptr %invariant.gep59, %scevgep81
  %bound186 = icmp ult ptr %invariant.gep, %scevgep79
  %found.conflict87 = and i1 %bound085, %bound186
  %conflict.rdx88 = or i1 %found.conflict84, %found.conflict87
  br i1 %conflict.rdx88, label %scalar.ph90.preheader, label %vector.ph92

vector.ph92:                                      ; preds = %vector.memcheck78
  %n.vec94 = and i64 %wide.trip.count56, 2147483644
  %27 = load double, ptr %8, align 8, !tbaa !11, !alias.scope !17
  %broadcast.splatinsert102 = insertelement <2 x double> poison, double %27, i64 0
  %broadcast.splat103 = shufflevector <2 x double> %broadcast.splatinsert102, <2 x double> poison, <2 x i32> zeroinitializer
  %28 = fneg <2 x double> %broadcast.splat103
  %29 = fneg <2 x double> %broadcast.splat103
  br label %vector.body96

vector.body96:                                    ; preds = %vector.body96, %vector.ph92
  %index97 = phi i64 [ 0, %vector.ph92 ], [ %index.next104, %vector.body96 ]
  %30 = getelementptr double, ptr %invariant.gep, i64 %index97
  %31 = getelementptr i8, ptr %30, i64 16
  %wide.load98 = load <2 x double>, ptr %30, align 8, !tbaa !20, !alias.scope !21
  %wide.load99 = load <2 x double>, ptr %31, align 8, !tbaa !20, !alias.scope !21
  %32 = getelementptr double, ptr %invariant.gep59, i64 %index97
  %33 = getelementptr i8, ptr %32, i64 16
  %wide.load100 = load <2 x double>, ptr %32, align 8, !tbaa !20, !alias.scope !23, !noalias !25
  %wide.load101 = load <2 x double>, ptr %33, align 8, !tbaa !20, !alias.scope !23, !noalias !25
  %34 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %28, <2 x double> %wide.load98, <2 x double> %wide.load100)
  %35 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %29, <2 x double> %wide.load99, <2 x double> %wide.load101)
  store <2 x double> %34, ptr %32, align 8, !tbaa !20, !alias.scope !23, !noalias !25
  store <2 x double> %35, ptr %33, align 8, !tbaa !20, !alias.scope !23, !noalias !25
  %index.next104 = add nuw i64 %index97, 4
  %36 = icmp eq i64 %index.next104, %n.vec94
  br i1 %36, label %middle.block89, label %vector.body96, !llvm.loop !26

middle.block89:                                   ; preds = %vector.body96
  %cmp.n105 = icmp eq i64 %n.vec94, %wide.trip.count56
  br i1 %cmp.n105, label %.loopexit, label %scalar.ph90.preheader

scalar.ph90.preheader:                            ; preds = %middle.block89, %vector.memcheck78, %.lr.ph50
  %indvars.iv53.ph = phi i64 [ 0, %vector.memcheck78 ], [ 0, %.lr.ph50 ], [ %n.vec94, %middle.block89 ]
  %xtraiter = and i64 %wide.trip.count56, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph90.prol.loopexit, label %scalar.ph90.prol

scalar.ph90.prol:                                 ; preds = %scalar.ph90.preheader
  %37 = load double, ptr %8, align 8, !tbaa !11
  %gep.prol = getelementptr double, ptr %invariant.gep, i64 %indvars.iv53.ph
  %38 = load double, ptr %gep.prol, align 8, !tbaa !20
  %gep60.prol = getelementptr double, ptr %invariant.gep59, i64 %indvars.iv53.ph
  %39 = load double, ptr %gep60.prol, align 8, !tbaa !20
  %40 = fneg double %37
  %41 = tail call double @llvm.fmuladd.f64(double %40, double %38, double %39)
  store double %41, ptr %gep60.prol, align 8, !tbaa !20
  %indvars.iv.next54.prol = or disjoint i64 %indvars.iv53.ph, 1
  br label %scalar.ph90.prol.loopexit

scalar.ph90.prol.loopexit:                        ; preds = %scalar.ph90.prol, %scalar.ph90.preheader
  %indvars.iv53.unr = phi i64 [ %indvars.iv53.ph, %scalar.ph90.preheader ], [ %indvars.iv.next54.prol, %scalar.ph90.prol ]
  %42 = add nsw i64 %wide.trip.count56, -1
  %43 = icmp eq i64 %indvars.iv53.ph, %42
  br i1 %43, label %.loopexit, label %scalar.ph90

scalar.ph90:                                      ; preds = %scalar.ph90.prol.loopexit, %scalar.ph90
  %indvars.iv53 = phi i64 [ %indvars.iv.next54.1, %scalar.ph90 ], [ %indvars.iv53.unr, %scalar.ph90.prol.loopexit ]
  %44 = load double, ptr %8, align 8, !tbaa !11
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv53
  %45 = load double, ptr %gep, align 8, !tbaa !20
  %gep60 = getelementptr double, ptr %invariant.gep59, i64 %indvars.iv53
  %46 = load double, ptr %gep60, align 8, !tbaa !20
  %47 = fneg double %44
  %48 = tail call double @llvm.fmuladd.f64(double %47, double %45, double %46)
  store double %48, ptr %gep60, align 8, !tbaa !20
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %49 = load double, ptr %8, align 8, !tbaa !11
  %gep.1 = getelementptr double, ptr %invariant.gep, i64 %indvars.iv.next54
  %50 = load double, ptr %gep.1, align 8, !tbaa !20
  %gep60.1 = getelementptr double, ptr %invariant.gep59, i64 %indvars.iv.next54
  %51 = load double, ptr %gep60.1, align 8, !tbaa !20
  %52 = fneg double %49
  %53 = tail call double @llvm.fmuladd.f64(double %52, double %50, double %51)
  store double %53, ptr %gep60.1, align 8, !tbaa !20
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 2
  %exitcond57.not.1 = icmp eq i64 %indvars.iv.next54.1, %wide.trip.count56
  br i1 %exitcond57.not.1, label %.loopexit, label %scalar.ph90, !llvm.loop !30

54:                                               ; preds = %5
  %55 = load i32, ptr %1, align 8, !tbaa !16
  %56 = icmp slt i32 %55, 0
  br i1 %56, label %57, label %.loopexit

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %1, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !15
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %.loopexit.sink.split, label %.loopexit

61:                                               ; preds = %3
  %62 = load i32, ptr %0, align 8, !tbaa !31
  %63 = getelementptr inbounds i8, ptr %1, i64 8
  %64 = load double, ptr %63, align 8, !tbaa !11
  %65 = fcmp une double %64, 0.000000e+00
  br i1 %65, label %.preheader46, label %126

.preheader46:                                     ; preds = %61
  %66 = icmp sgt i32 %62, 0
  br i1 %66, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader46
  %67 = getelementptr inbounds i8, ptr %0, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds i8, ptr %1, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = getelementptr inbounds i8, ptr %0, i64 4
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %1, align 8, !tbaa !16
  %wide.trip.count = zext nneg i32 %62 to i64
  %min.iters.check = icmp ult i32 %62, 20
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph
  %ident.check = icmp ne i32 %72, 1
  %74 = add nsw i64 %wide.trip.count, -1
  %75 = add i32 %73, -1
  %76 = trunc nsw i64 %74 to i32
  %77 = add i32 %75, %76
  %78 = icmp slt i32 %77, %75
  %79 = icmp ugt i64 %74, 4294967295
  %80 = or i1 %78, %79
  %81 = add i32 %70, -1
  %82 = trunc nsw i64 %74 to i32
  %83 = add i32 %81, %82
  %84 = icmp slt i32 %83, %81
  %85 = or i1 %ident.check, %80
  %86 = or i1 %84, %85
  br i1 %86, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %87 = add i32 %73, -1
  %88 = sext i32 %87 to i64
  %89 = shl nsw i64 %88, 3
  %scevgep = getelementptr i8, ptr %68, i64 %89
  %90 = shl nuw nsw i64 %wide.trip.count, 3
  %91 = getelementptr i8, ptr %68, i64 %89
  %scevgep66 = getelementptr i8, ptr %91, i64 %90
  %scevgep67 = getelementptr i8, ptr %1, i64 16
  %92 = add i32 %70, -1
  %93 = sext i32 %92 to i64
  %94 = shl nsw i64 %93, 3
  %scevgep68 = getelementptr i8, ptr %68, i64 %94
  %95 = getelementptr i8, ptr %68, i64 %94
  %scevgep69 = getelementptr i8, ptr %95, i64 %90
  %bound0 = icmp ult ptr %scevgep, %scevgep67
  %bound1 = icmp ult ptr %63, %scevgep66
  %found.conflict = and i1 %bound0, %bound1
  %bound070 = icmp ult ptr %scevgep, %scevgep69
  %bound171 = icmp ult ptr %scevgep68, %scevgep66
  %found.conflict72 = and i1 %bound070, %bound171
  %conflict.rdx = or i1 %found.conflict, %found.conflict72
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483644
  %96 = load double, ptr %63, align 8, !tbaa !11, !alias.scope !32
  %broadcast.splatinsert76 = insertelement <2 x double> poison, double %96, i64 0
  %broadcast.splat77 = shufflevector <2 x double> %broadcast.splatinsert76, <2 x double> poison, <2 x i32> zeroinitializer
  %97 = fneg <2 x double> %broadcast.splat77
  %98 = fneg <2 x double> %broadcast.splat77
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %99 = trunc i64 %index to i32
  %100 = add i32 %99, -1
  %101 = add i32 %100, %70
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds double, ptr %68, i64 %102
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %wide.load = load <2 x double>, ptr %103, align 8, !tbaa !20, !alias.scope !35
  %wide.load73 = load <2 x double>, ptr %104, align 8, !tbaa !20, !alias.scope !35
  %105 = add i32 %100, %73
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %68, i64 %106
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  %wide.load74 = load <2 x double>, ptr %107, align 8, !tbaa !20, !alias.scope !37, !noalias !39
  %wide.load75 = load <2 x double>, ptr %108, align 8, !tbaa !20, !alias.scope !37, !noalias !39
  %109 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %97, <2 x double> %wide.load, <2 x double> %wide.load74)
  %110 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %98, <2 x double> %wide.load73, <2 x double> %wide.load75)
  store <2 x double> %109, ptr %107, align 8, !tbaa !20, !alias.scope !37, !noalias !39
  store <2 x double> %110, ptr %108, align 8, !tbaa !20, !alias.scope !37, !noalias !39
  %index.next = add nuw i64 %index, 4
  %111 = icmp eq i64 %index.next, %n.vec
  br i1 %111, label %middle.block, label %vector.body, !llvm.loop !40

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

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %vector.scevcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %112 = load double, ptr %63, align 8, !tbaa !11
  %113 = trunc i64 %indvars.iv to i32
  %114 = mul i32 %72, %113
  %115 = add i32 %114, -1
  %116 = add i32 %115, %70
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds double, ptr %68, i64 %117
  %119 = load double, ptr %118, align 8, !tbaa !20
  %120 = add i32 %115, %73
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %68, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !20
  %124 = fneg double %112
  %125 = tail call double @llvm.fmuladd.f64(double %124, double %119, double %123)
  store double %125, ptr %122, align 8, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !41

126:                                              ; preds = %61
  %127 = load i32, ptr %1, align 8, !tbaa !16
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %129, label %.loopexit

129:                                              ; preds = %126
  %130 = getelementptr inbounds i8, ptr %1, i64 4
  %131 = load i32, ptr %130, align 4, !tbaa !15
  %132 = icmp slt i32 %131, 0
  br i1 %132, label %.loopexit.sink.split, label %.loopexit

.loopexit.sink.split:                             ; preds = %129, %57
  %.sink64 = phi i32 [ %55, %57 ], [ %127, %129 ]
  %.sink63 = phi i32 [ %59, %57 ], [ %131, %129 ]
  %.sink62 = phi i32 [ 1, %57 ], [ %2, %129 ]
  %133 = sub nsw i32 0, %.sink64
  %134 = sub nsw i32 0, %.sink63
  %135 = tail call i32 @M_Swap(ptr noundef nonnull %0, i32 noundef %133, i32 noundef %134, i32 noundef %.sink62)
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph, %scalar.ph90.prol.loopexit, %scalar.ph90, %middle.block, %middle.block89, %.loopexit.sink.split, %.preheader46, %.preheader, %129, %126, %57, %54
  ret i32 0
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @M_Swap(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #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>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !7, i64 4}
!6 = !{!"_Matrix", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !13, i64 8}
!12 = !{!"_Elementary_Transformation", !7, i64 0, !7, i64 4, !13, i64 8, !10, i64 16, !10, i64 24}
!13 = !{!"double", !8, i64 0}
!14 = !{!6, !10, i64 8}
!15 = !{!12, !7, i64 4}
!16 = !{!12, !7, i64 0}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!13, !13, i64 0}
!21 = !{!22}
!22 = distinct !{!22, !19}
!23 = !{!24}
!24 = distinct !{!24, !19}
!25 = !{!18, !22}
!26 = distinct !{!26, !27, !28, !29}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!"llvm.loop.isvectorized", i32 1}
!29 = !{!"llvm.loop.unroll.runtime.disable"}
!30 = distinct !{!30, !27, !28}
!31 = !{!6, !7, i64 0}
!32 = !{!33}
!33 = distinct !{!33, !34}
!34 = distinct !{!34, !"LVerDomain"}
!35 = !{!36}
!36 = distinct !{!36, !34}
!37 = !{!38}
!38 = distinct !{!38, !34}
!39 = !{!33, !36}
!40 = distinct !{!40, !27, !28, !29}
!41 = distinct !{!41, !27, !28}


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