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

@.str.15 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1

; 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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @M_Swap(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  %11 = load i32, ptr %6, align 4, !tbaa !9
  %12 = sub nsw i32 %11, 1
  store i32 %12, ptr %6, align 4, !tbaa !9
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = sub nsw i32 %13, 1
  store i32 %14, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %15 = load i32, ptr %8, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %17, label %96

17:                                               ; preds = %4
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._Matrix, ptr %19, i32 0, i32 0
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = icmp slt i32 %18, %21
  br i1 %22, label %23, label %92

23:                                               ; preds = %17
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._Matrix, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = icmp slt i32 %24, %27
  br i1 %28, label %29, label %92

29:                                               ; preds = %23
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %88, %29
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._Matrix, ptr %32, i32 0, i32 1
  %34 = load i32, ptr %33, align 4, !tbaa !13
  %35 = icmp slt i32 %31, %34
  br i1 %35, label %36, label %91

36:                                               ; preds = %30
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._Matrix, ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._Matrix, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !13
  %44 = mul nsw i32 %40, %43
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = add nsw i32 %44, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %39, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !15
  store double %49, ptr %10, align 8, !tbaa !15
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct._Matrix, ptr %50, i32 0, i32 2
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._Matrix, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !13
  %57 = mul nsw i32 %53, %56
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds double, ptr %52, i64 %60
  %62 = load double, ptr %61, align 8, !tbaa !15
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._Matrix, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._Matrix, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !13
  %70 = mul nsw i32 %66, %69
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = add nsw i32 %70, %71
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %65, i64 %73
  store double %62, ptr %74, align 8, !tbaa !15
  %75 = load double, ptr %10, align 8, !tbaa !15
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._Matrix, ptr %76, i32 0, i32 2
  %78 = load ptr, ptr %77, align 8, !tbaa !14
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._Matrix, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !13
  %83 = mul nsw i32 %79, %82
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = add nsw i32 %83, %84
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds double, ptr %78, i64 %86
  store double %75, ptr %87, align 8, !tbaa !15
  br label %88

88:                                               ; preds = %36
  %89 = load i32, ptr %9, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !9
  br label %30, !llvm.loop !17

91:                                               ; preds = %30
  br label %95

92:                                               ; preds = %23, %17
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %94 = call i32 @system(ptr noundef @.str.16)
  br label %95

95:                                               ; preds = %92, %91
  br label %175

96:                                               ; preds = %4
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._Matrix, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !13
  %101 = icmp slt i32 %97, %100
  br i1 %101, label %102, label %171

102:                                              ; preds = %96
  %103 = load i32, ptr %7, align 4, !tbaa !9
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._Matrix, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !13
  %107 = icmp slt i32 %103, %106
  br i1 %107, label %108, label %171

108:                                              ; preds = %102
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %167, %108
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._Matrix, ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !11
  %114 = icmp slt i32 %110, %113
  br i1 %114, label %115, label %170

115:                                              ; preds = %109
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct._Matrix, ptr %116, i32 0, i32 2
  %118 = load ptr, ptr %117, align 8, !tbaa !14
  %119 = load i32, ptr %6, align 4, !tbaa !9
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._Matrix, ptr %120, i32 0, i32 1
  %122 = load i32, ptr %121, align 4, !tbaa !13
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = mul nsw i32 %122, %123
  %125 = add nsw i32 %119, %124
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds double, ptr %118, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !15
  store double %128, ptr %10, align 8, !tbaa !15
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._Matrix, ptr %129, i32 0, i32 2
  %131 = load ptr, ptr %130, align 8, !tbaa !14
  %132 = load i32, ptr %7, align 4, !tbaa !9
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct._Matrix, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !13
  %136 = load i32, ptr %9, align 4, !tbaa !9
  %137 = mul nsw i32 %135, %136
  %138 = add nsw i32 %132, %137
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds double, ptr %131, i64 %139
  %141 = load double, ptr %140, align 8, !tbaa !15
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._Matrix, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !14
  %145 = load i32, ptr %6, align 4, !tbaa !9
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._Matrix, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !13
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = mul nsw i32 %148, %149
  %151 = add nsw i32 %145, %150
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds double, ptr %144, i64 %152
  store double %141, ptr %153, align 8, !tbaa !15
  %154 = load double, ptr %10, align 8, !tbaa !15
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._Matrix, ptr %155, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !14
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._Matrix, ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !13
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = mul nsw i32 %161, %162
  %164 = add nsw i32 %158, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds double, ptr %157, i64 %165
  store double %154, ptr %166, align 8, !tbaa !15
  br label %167

167:                                              ; preds = %115
  %168 = load i32, ptr %9, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %9, align 4, !tbaa !9
  br label %109, !llvm.loop !19

170:                                              ; preds = %109
  br label %174

171:                                              ; preds = %102, %96
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %173 = call i32 @system(ptr noundef @.str.16)
  br label %174

174:                                              ; preds = %171, %170
  br label %175

175:                                              ; preds = %174, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret i32 0
}

declare i32 @system(ptr noundef) #1

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


; 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.15 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @M_Swap(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 {
  %5 = add nsw i32 %1, -1
  %6 = add nsw i32 %2, -1
  %7 = icmp eq i32 %3, 1
  br i1 %7, label %8, label %36

8:                                                ; preds = %4
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %.not58 = icmp slt i32 %9, %1
  %.not59 = icmp slt i32 %9, %2
  %or.cond = or i1 %.not58, %.not59
  br i1 %or.cond, label %.loopexit.sink.split, label %.preheader

.preheader:                                       ; preds = %8
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !11
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph65, label %.loopexit

.lr.ph65:                                         ; preds = %.preheader
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = mul nsw i32 %11, %5
  %16 = mul nsw i32 %11, %6
  %17 = sext i32 %15 to i64
  %18 = sext i32 %16 to i64
  %wide.trip.count71 = zext nneg i32 %11 to i64
  %invariant.gep76 = getelementptr double, ptr %14, i64 %17
  %invariant.gep78 = getelementptr double, ptr %14, i64 %18
  %min.iters.check93 = icmp ult i32 %11, 14
  br i1 %min.iters.check93, label %scalar.ph92.preheader, label %vector.memcheck85

vector.memcheck85:                                ; preds = %.lr.ph65
  %19 = add nsw i64 %17, %wide.trip.count71
  %20 = shl nsw i64 %19, 3
  %scevgep86 = getelementptr i8, ptr %14, i64 %20
  %21 = add nsw i64 %18, %wide.trip.count71
  %22 = shl nsw i64 %21, 3
  %scevgep87 = getelementptr i8, ptr %14, i64 %22
  %bound088 = icmp ult ptr %invariant.gep76, %scevgep87
  %bound189 = icmp ult ptr %invariant.gep78, %scevgep86
  %found.conflict90 = and i1 %bound088, %bound189
  br i1 %found.conflict90, label %scalar.ph92.preheader, label %vector.ph94

vector.ph94:                                      ; preds = %vector.memcheck85
  %n.vec96 = and i64 %wide.trip.count71, 2147483644
  br label %vector.body98

vector.body98:                                    ; preds = %vector.body98, %vector.ph94
  %index99 = phi i64 [ 0, %vector.ph94 ], [ %index.next104, %vector.body98 ]
  %23 = getelementptr double, ptr %invariant.gep76, i64 %index99
  %24 = getelementptr i8, ptr %23, i64 16
  %wide.load100 = load <2 x double>, ptr %23, align 8, !tbaa !13, !alias.scope !15, !noalias !18
  %wide.load101 = load <2 x double>, ptr %24, align 8, !tbaa !13, !alias.scope !15, !noalias !18
  %25 = getelementptr double, ptr %invariant.gep78, i64 %index99
  %26 = getelementptr i8, ptr %25, i64 16
  %wide.load102 = load <2 x double>, ptr %25, align 8, !tbaa !13, !alias.scope !18
  %wide.load103 = load <2 x double>, ptr %26, align 8, !tbaa !13, !alias.scope !18
  store <2 x double> %wide.load102, ptr %23, align 8, !tbaa !13, !alias.scope !15, !noalias !18
  store <2 x double> %wide.load103, ptr %24, align 8, !tbaa !13, !alias.scope !15, !noalias !18
  store <2 x double> %wide.load100, ptr %25, align 8, !tbaa !13, !alias.scope !18
  store <2 x double> %wide.load101, ptr %26, align 8, !tbaa !13, !alias.scope !18
  %index.next104 = add nuw i64 %index99, 4
  %27 = icmp eq i64 %index.next104, %n.vec96
  br i1 %27, label %middle.block91, label %vector.body98, !llvm.loop !20

middle.block91:                                   ; preds = %vector.body98
  %cmp.n105 = icmp eq i64 %n.vec96, %wide.trip.count71
  br i1 %cmp.n105, label %.loopexit, label %scalar.ph92.preheader

scalar.ph92.preheader:                            ; preds = %middle.block91, %vector.memcheck85, %.lr.ph65
  %indvars.iv68.ph = phi i64 [ 0, %vector.memcheck85 ], [ 0, %.lr.ph65 ], [ %n.vec96, %middle.block91 ]
  %xtraiter108 = and i64 %wide.trip.count71, 1
  %lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
  br i1 %lcmp.mod109.not, label %scalar.ph92.prol.loopexit, label %scalar.ph92.prol

scalar.ph92.prol:                                 ; preds = %scalar.ph92.preheader
  %gep77.prol = getelementptr double, ptr %invariant.gep76, i64 %indvars.iv68.ph
  %28 = load double, ptr %gep77.prol, align 8, !tbaa !13
  %gep79.prol = getelementptr double, ptr %invariant.gep78, i64 %indvars.iv68.ph
  %29 = load double, ptr %gep79.prol, align 8, !tbaa !13
  store double %29, ptr %gep77.prol, align 8, !tbaa !13
  store double %28, ptr %gep79.prol, align 8, !tbaa !13
  %indvars.iv.next69.prol = or disjoint i64 %indvars.iv68.ph, 1
  br label %scalar.ph92.prol.loopexit

scalar.ph92.prol.loopexit:                        ; preds = %scalar.ph92.prol, %scalar.ph92.preheader
  %indvars.iv68.unr = phi i64 [ %indvars.iv68.ph, %scalar.ph92.preheader ], [ %indvars.iv.next69.prol, %scalar.ph92.prol ]
  %30 = add nsw i64 %wide.trip.count71, -1
  %31 = icmp eq i64 %indvars.iv68.ph, %30
  br i1 %31, label %.loopexit, label %scalar.ph92

scalar.ph92:                                      ; preds = %scalar.ph92.prol.loopexit, %scalar.ph92
  %indvars.iv68 = phi i64 [ %indvars.iv.next69.1, %scalar.ph92 ], [ %indvars.iv68.unr, %scalar.ph92.prol.loopexit ]
  %gep77 = getelementptr double, ptr %invariant.gep76, i64 %indvars.iv68
  %32 = load double, ptr %gep77, align 8, !tbaa !13
  %gep79 = getelementptr double, ptr %invariant.gep78, i64 %indvars.iv68
  %33 = load double, ptr %gep79, align 8, !tbaa !13
  store double %33, ptr %gep77, align 8, !tbaa !13
  store double %32, ptr %gep79, align 8, !tbaa !13
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %gep77.1 = getelementptr double, ptr %invariant.gep76, i64 %indvars.iv.next69
  %34 = load double, ptr %gep77.1, align 8, !tbaa !13
  %gep79.1 = getelementptr double, ptr %invariant.gep78, i64 %indvars.iv.next69
  %35 = load double, ptr %gep79.1, align 8, !tbaa !13
  store double %35, ptr %gep77.1, align 8, !tbaa !13
  store double %34, ptr %gep79.1, align 8, !tbaa !13
  %indvars.iv.next69.1 = add nuw nsw i64 %indvars.iv68, 2
  %exitcond72.not.1 = icmp eq i64 %indvars.iv.next69.1, %wide.trip.count71
  br i1 %exitcond72.not.1, label %.loopexit, label %scalar.ph92, !llvm.loop !24

36:                                               ; preds = %4
  %37 = getelementptr inbounds i8, ptr %0, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %.not = icmp slt i32 %38, %1
  %.not57 = icmp slt i32 %38, %2
  %or.cond60 = or i1 %.not, %.not57
  br i1 %or.cond60, label %.loopexit.sink.split, label %.preheader61

.preheader61:                                     ; preds = %36
  %39 = load i32, ptr %0, align 8, !tbaa !5
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader61
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !12
  %43 = sext i32 %38 to i64
  %44 = sext i32 %5 to i64
  %45 = sext i32 %6 to i64
  %wide.trip.count = zext nneg i32 %39 to i64
  %invariant.gep = getelementptr double, ptr %42, i64 %44
  %invariant.gep74 = getelementptr double, ptr %42, i64 %45
  %min.iters.check = icmp ugt i32 %39, 15
  %ident.check.not = icmp eq i32 %38, 1
  %or.cond106 = and i1 %min.iters.check, %ident.check.not
  br i1 %or.cond106, label %vector.memcheck, label %scalar.ph.preheader

vector.memcheck:                                  ; preds = %.lr.ph
  %46 = add nsw i64 %44, %wide.trip.count
  %47 = shl nsw i64 %46, 3
  %scevgep = getelementptr i8, ptr %42, i64 %47
  %48 = add nsw i64 %45, %wide.trip.count
  %49 = shl nsw i64 %48, 3
  %scevgep81 = getelementptr i8, ptr %42, i64 %49
  %bound0 = icmp ult ptr %invariant.gep, %scevgep81
  %bound1 = icmp ult ptr %invariant.gep74, %scevgep
  %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 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %50 = getelementptr double, ptr %invariant.gep, i64 %index
  %51 = getelementptr i8, ptr %50, i64 16
  %wide.load = load <2 x double>, ptr %50, align 8, !tbaa !13, !alias.scope !25, !noalias !28
  %wide.load82 = load <2 x double>, ptr %51, align 8, !tbaa !13, !alias.scope !25, !noalias !28
  %52 = getelementptr double, ptr %invariant.gep74, i64 %index
  %53 = getelementptr i8, ptr %52, i64 16
  %wide.load83 = load <2 x double>, ptr %52, align 8, !tbaa !13, !alias.scope !28
  %wide.load84 = load <2 x double>, ptr %53, align 8, !tbaa !13, !alias.scope !28
  store <2 x double> %wide.load83, ptr %50, align 8, !tbaa !13, !alias.scope !25, !noalias !28
  store <2 x double> %wide.load84, ptr %51, align 8, !tbaa !13, !alias.scope !25, !noalias !28
  store <2 x double> %wide.load, ptr %52, align 8, !tbaa !13, !alias.scope !28
  store <2 x double> %wide.load82, ptr %53, align 8, !tbaa !13, !alias.scope !28
  %index.next = add nuw i64 %index, 4
  %54 = icmp eq i64 %index.next, %n.vec
  br i1 %54, label %middle.block, label %vector.body, !llvm.loop !30

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, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 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
  %55 = mul nsw i64 %indvars.iv.ph, %43
  %gep.prol = getelementptr double, ptr %invariant.gep, i64 %55
  %56 = load double, ptr %gep.prol, align 8, !tbaa !13
  %gep75.prol = getelementptr double, ptr %invariant.gep74, i64 %55
  %57 = load double, ptr %gep75.prol, align 8, !tbaa !13
  store double %57, ptr %gep.prol, align 8, !tbaa !13
  store double %56, ptr %gep75.prol, align 8, !tbaa !13
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %58 = add nsw i64 %wide.trip.count, -1
  %59 = icmp eq i64 %indvars.iv.ph, %58
  br i1 %59, label %.loopexit, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %60 = mul nsw i64 %indvars.iv, %43
  %gep = getelementptr double, ptr %invariant.gep, i64 %60
  %61 = load double, ptr %gep, align 8, !tbaa !13
  %gep75 = getelementptr double, ptr %invariant.gep74, i64 %60
  %62 = load double, ptr %gep75, align 8, !tbaa !13
  store double %62, ptr %gep, align 8, !tbaa !13
  store double %61, ptr %gep75, align 8, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %63 = mul nsw i64 %indvars.iv.next, %43
  %gep.1 = getelementptr double, ptr %invariant.gep, i64 %63
  %64 = load double, ptr %gep.1, align 8, !tbaa !13
  %gep75.1 = getelementptr double, ptr %invariant.gep74, i64 %63
  %65 = load double, ptr %gep75.1, align 8, !tbaa !13
  store double %65, ptr %gep.1, align 8, !tbaa !13
  store double %64, ptr %gep75.1, align 8, !tbaa !13
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %.loopexit, label %scalar.ph, !llvm.loop !31

.loopexit.sink.split:                             ; preds = %36, %8
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %67 = tail call i32 @system(ptr noundef nonnull @.str.16) #3
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %scalar.ph92.prol.loopexit, %scalar.ph92, %middle.block, %middle.block91, %.loopexit.sink.split, %.preheader61, %.preheader
  ret i32 0
}

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #2

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 = { nofree "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, !7, i64 0}
!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 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21, !22}
!25 = !{!26}
!26 = distinct !{!26, !27}
!27 = distinct !{!27, !"LVerDomain"}
!28 = !{!29}
!29 = distinct !{!29, !27}
!30 = distinct !{!30, !21, !22, !23}
!31 = distinct !{!31, !21, !22}


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