; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_MatNd)

; 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._MatNd = type { ptr, i32, i32, i32, i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.MatNd_columnCrossProduct = external hidden unnamed_addr constant [25 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

declare void @print_trace() #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

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

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

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

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._MatNd, ptr %12, i32 0, i32 1
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = icmp eq i32 %14, 3
  br i1 %15, label %26, label %16

16:                                               ; preds = %11
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_columnCrossProduct, i32 noundef 2833, ptr noundef @.str.168) #6
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct._MatNd, ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str.169, i32 noundef %22) #6
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

26:                                               ; preds = %11
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._MatNd, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = icmp eq i32 %32, 3
  br i1 %33, label %44, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_columnCrossProduct, i32 noundef 2834, ptr noundef @.str.170) #6
  %37 = load ptr, ptr @stderr, align 8, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct._MatNd, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.169, i32 noundef %40) #6
  %42 = load ptr, ptr @stderr, align 8, !tbaa !5
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

44:                                               ; preds = %29
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._MatNd, ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._MatNd, ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !13
  %54 = icmp eq i32 %50, %53
  br i1 %54, label %68, label %55

55:                                               ; preds = %47
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str, ptr noundef @.str.1, ptr noundef @__func__.MatNd_columnCrossProduct, i32 noundef 2837, ptr noundef @.str.171) #6
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._MatNd, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %60, align 4, !tbaa !13
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._MatNd, ptr %62, i32 0, i32 2
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.172, i32 noundef %61, i32 noundef %64) #6
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.4) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

68:                                               ; preds = %47
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %71

71:                                               ; preds = %185, %70
  %72 = load i32, ptr %8, align 4, !tbaa !14
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._MatNd, ptr %73, i32 0, i32 2
  %75 = load i32, ptr %74, align 4, !tbaa !13
  %76 = icmp ult i32 %72, %75
  br i1 %76, label %77, label %188

77:                                               ; preds = %71
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._MatNd, ptr %78, i32 0, i32 2
  %80 = load i32, ptr %79, align 4, !tbaa !13
  %81 = load i32, ptr %8, align 4, !tbaa !14
  %82 = add i32 %80, %81
  store i32 %82, ptr %9, align 4, !tbaa !14
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._MatNd, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !13
  %86 = mul i32 2, %85
  %87 = load i32, ptr %8, align 4, !tbaa !14
  %88 = add i32 %86, %87
  store i32 %88, ptr %10, align 4, !tbaa !14
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds double, ptr %89, i64 1
  %91 = load double, ptr %90, align 8, !tbaa !15
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct._MatNd, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !17
  %95 = load i32, ptr %10, align 4, !tbaa !14
  %96 = zext i32 %95 to i64
  %97 = getelementptr inbounds double, ptr %94, i64 %96
  %98 = load double, ptr %97, align 8, !tbaa !15
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds double, ptr %99, i64 2
  %101 = load double, ptr %100, align 8, !tbaa !15
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct._MatNd, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !17
  %105 = load i32, ptr %9, align 4, !tbaa !14
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %104, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !15
  %109 = fmul double %101, %108
  %110 = fneg double %109
  %111 = call double @llvm.fmuladd.f64(double %91, double %98, double %110)
  %112 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  store double %111, ptr %112, align 16, !tbaa !15
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds double, ptr %113, i64 0
  %115 = load double, ptr %114, align 8, !tbaa !15
  %116 = fneg double %115
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._MatNd, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !17
  %120 = load i32, ptr %10, align 4, !tbaa !14
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds double, ptr %119, i64 %121
  %123 = load double, ptr %122, align 8, !tbaa !15
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds double, ptr %124, i64 2
  %126 = load double, ptr %125, align 8, !tbaa !15
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct._MatNd, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !17
  %130 = load i32, ptr %8, align 4, !tbaa !14
  %131 = zext i32 %130 to i64
  %132 = getelementptr inbounds double, ptr %129, i64 %131
  %133 = load double, ptr %132, align 8, !tbaa !15
  %134 = fmul double %126, %133
  %135 = call double @llvm.fmuladd.f64(double %116, double %123, double %134)
  %136 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 1
  store double %135, ptr %136, align 8, !tbaa !15
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds double, ptr %137, i64 0
  %139 = load double, ptr %138, align 8, !tbaa !15
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct._MatNd, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !17
  %143 = load i32, ptr %9, align 4, !tbaa !14
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds double, ptr %142, i64 %144
  %146 = load double, ptr %145, align 8, !tbaa !15
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds double, ptr %147, i64 1
  %149 = load double, ptr %148, align 8, !tbaa !15
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._MatNd, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !17
  %153 = load i32, ptr %8, align 4, !tbaa !14
  %154 = zext i32 %153 to i64
  %155 = getelementptr inbounds double, ptr %152, i64 %154
  %156 = load double, ptr %155, align 8, !tbaa !15
  %157 = fmul double %149, %156
  %158 = fneg double %157
  %159 = call double @llvm.fmuladd.f64(double %139, double %146, double %158)
  %160 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 2
  store double %159, ptr %160, align 16, !tbaa !15
  %161 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 0
  %162 = load double, ptr %161, align 16, !tbaa !15
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._MatNd, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %164, align 8, !tbaa !17
  %166 = load i32, ptr %8, align 4, !tbaa !14
  %167 = zext i32 %166 to i64
  %168 = getelementptr inbounds double, ptr %165, i64 %167
  store double %162, ptr %168, align 8, !tbaa !15
  %169 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 1
  %170 = load double, ptr %169, align 8, !tbaa !15
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._MatNd, ptr %171, i32 0, i32 0
  %173 = load ptr, ptr %172, align 8, !tbaa !17
  %174 = load i32, ptr %9, align 4, !tbaa !14
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds double, ptr %173, i64 %175
  store double %170, ptr %176, align 8, !tbaa !15
  %177 = getelementptr inbounds [3 x double], ptr %7, i64 0, i64 2
  %178 = load double, ptr %177, align 16, !tbaa !15
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._MatNd, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !17
  %182 = load i32, ptr %10, align 4, !tbaa !14
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds double, ptr %181, i64 %183
  store double %178, ptr %184, align 8, !tbaa !15
  br label %185

185:                                              ; preds = %77
  %186 = load i32, ptr %8, align 4, !tbaa !14
  %187 = add i32 %186, 1
  store i32 %187, ptr %8, align 4, !tbaa !14
  br label %71, !llvm.loop !18

188:                                              ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  ret void
}

attributes #0 = { 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 = { "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 = { noreturn 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn 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, !11, i64 8}
!10 = !{!"_MatNd", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 20}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!10, !11, i64 12}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!10, !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@__func__.MatNd_columnCrossProduct = external hidden unnamed_addr constant [25 x i8], align 1
@.str.168 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.169 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.170 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.171 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.172 = external hidden unnamed_addr constant [58 x i8], align 1

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

declare void @print_trace() local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 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

; Function Attrs: nounwind uwtable
define dso_local void @MatNd_columnCrossProduct(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #4 {
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 3
  br i1 %6, label %15, label %7

7:                                                ; preds = %3
  %8 = load ptr, ptr @stderr, align 8, !tbaa !12
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_columnCrossProduct, i32 noundef 2833, ptr noundef nonnull @.str.168) #6
  %10 = load ptr, ptr @stderr, align 8, !tbaa !12
  %11 = load i32, ptr %4, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.169, i32 noundef %11) #6
  %13 = load ptr, ptr @stderr, align 8, !tbaa !12
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

15:                                               ; preds = %3
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = icmp eq i32 %17, 3
  br i1 %18, label %27, label %19

19:                                               ; preds = %15
  %20 = load ptr, ptr @stderr, align 8, !tbaa !12
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_columnCrossProduct, i32 noundef 2834, ptr noundef nonnull @.str.170) #6
  %22 = load ptr, ptr @stderr, align 8, !tbaa !12
  %23 = load i32, ptr %16, align 8, !tbaa !5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.169, i32 noundef %23) #6
  %25 = load ptr, ptr @stderr, align 8, !tbaa !12
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

27:                                               ; preds = %15
  %28 = getelementptr inbounds i8, ptr %1, i64 12
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %0, i64 12
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = icmp eq i32 %29, %31
  br i1 %32, label %.preheader, label %77

.preheader:                                       ; preds = %27
  %.not = icmp eq i32 %29, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %33 = shl i32 %29, 1
  %34 = getelementptr i8, ptr %2, i64 8
  %35 = load ptr, ptr %1, align 8, !tbaa !14
  %36 = getelementptr i8, ptr %2, i64 16
  %37 = load ptr, ptr %0, align 8, !tbaa !14
  %wide.trip.count = zext i32 %29 to i64
  %min.iters.check = icmp ult i32 %29, 28
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

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

vector.scevcheck:                                 ; preds = %.lr.ph
  %38 = add nsw i64 %wide.trip.count, -1
  %39 = trunc i64 %38 to i32
  %40 = xor i32 %29, -1
  %41 = icmp ult i32 %40, %39
  %42 = trunc i64 %38 to i32
  %43 = xor i32 %33, -1
  %44 = icmp ult i32 %43, %42
  %45 = icmp ugt i64 %38, 4294967295
  %46 = or i1 %44, %45
  %47 = or i1 %41, %46
  br i1 %47, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %48 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr %37, i64 %48
  %49 = shl nuw nsw i64 %wide.trip.count, 4
  %scevgep41 = getelementptr i8, ptr %37, i64 %49
  %50 = zext i32 %33 to i64
  %51 = shl nuw nsw i64 %50, 3
  %scevgep42 = getelementptr i8, ptr %37, i64 %51
  %52 = add nuw nsw i64 %48, %51
  %scevgep43 = getelementptr i8, ptr %37, i64 %52
  %scevgep44 = getelementptr i8, ptr %35, i64 %51
  %scevgep45 = getelementptr i8, ptr %35, i64 %52
  %scevgep46 = getelementptr i8, ptr %2, i64 24
  %scevgep47 = getelementptr i8, ptr %35, i64 %48
  %scevgep48 = getelementptr i8, ptr %35, i64 %49
  %bound049 = icmp ult ptr %37, %scevgep43
  %bound1 = icmp ult ptr %scevgep42, %scevgep
  %found.conflict = and i1 %bound049, %bound1
  %bound050 = icmp ult ptr %37, %36
  %bound151 = icmp ult ptr %34, %scevgep
  %found.conflict52 = and i1 %bound050, %bound151
  %conflict.rdx = or i1 %found.conflict, %found.conflict52
  %bound053 = icmp ult ptr %37, %scevgep45
  %bound154 = icmp ult ptr %scevgep44, %scevgep
  %found.conflict55 = and i1 %bound053, %bound154
  %conflict.rdx56 = or i1 %conflict.rdx, %found.conflict55
  %bound057 = icmp ult ptr %37, %scevgep46
  %bound158 = icmp ult ptr %36, %scevgep
  %found.conflict59 = and i1 %bound057, %bound158
  %conflict.rdx60 = or i1 %conflict.rdx56, %found.conflict59
  %bound061 = icmp ult ptr %37, %scevgep48
  %bound162 = icmp ult ptr %35, %37
  %found.conflict63 = and i1 %bound061, %bound162
  %conflict.rdx64 = or i1 %conflict.rdx60, %found.conflict63
  %bound065 = icmp ult ptr %37, %34
  %bound166 = icmp ugt ptr %scevgep, %2
  %found.conflict67 = and i1 %bound065, %bound166
  %conflict.rdx68 = or i1 %conflict.rdx64, %found.conflict67
  %bound069 = icmp ult ptr %37, %scevgep47
  %bound170 = icmp ult ptr %35, %scevgep
  %found.conflict71 = and i1 %bound069, %bound170
  %conflict.rdx72 = or i1 %conflict.rdx68, %found.conflict71
  %bound073 = icmp ult ptr %scevgep, %scevgep43
  %bound174 = icmp ult ptr %scevgep42, %scevgep41
  %found.conflict75 = and i1 %bound073, %bound174
  %conflict.rdx76 = or i1 %conflict.rdx72, %found.conflict75
  %bound077 = icmp ult ptr %scevgep, %36
  %bound178 = icmp ult ptr %34, %scevgep41
  %found.conflict79 = and i1 %bound077, %bound178
  %conflict.rdx80 = or i1 %conflict.rdx76, %found.conflict79
  %bound081 = icmp ult ptr %scevgep, %scevgep45
  %bound182 = icmp ult ptr %scevgep44, %scevgep41
  %found.conflict83 = and i1 %bound081, %bound182
  %conflict.rdx84 = or i1 %conflict.rdx80, %found.conflict83
  %bound085 = icmp ult ptr %scevgep, %scevgep46
  %bound186 = icmp ult ptr %36, %scevgep41
  %found.conflict87 = and i1 %bound085, %bound186
  %conflict.rdx88 = or i1 %conflict.rdx84, %found.conflict87
  %bound089 = icmp ult ptr %scevgep, %scevgep48
  %bound190 = icmp ult ptr %scevgep47, %scevgep41
  %found.conflict91 = and i1 %bound089, %bound190
  %conflict.rdx92 = or i1 %conflict.rdx88, %found.conflict91
  %bound093 = icmp ult ptr %scevgep, %34
  %bound194 = icmp ugt ptr %scevgep41, %2
  %found.conflict95 = and i1 %bound093, %bound194
  %conflict.rdx96 = or i1 %conflict.rdx92, %found.conflict95
  %bound097 = icmp ult ptr %37, %35
  %bound198 = icmp ult ptr %35, %scevgep41
  %found.conflict99 = and i1 %bound097, %bound198
  %conflict.rdx100 = or i1 %conflict.rdx96, %found.conflict99
  %bound0101 = icmp ult ptr %scevgep42, %36
  %bound1102 = icmp ult ptr %34, %scevgep43
  %found.conflict103 = and i1 %bound0101, %bound1102
  %conflict.rdx104 = or i1 %conflict.rdx100, %found.conflict103
  %bound0105 = icmp ult ptr %scevgep42, %scevgep45
  %bound1106 = icmp ult ptr %scevgep44, %scevgep43
  %found.conflict107 = and i1 %bound0105, %bound1106
  %conflict.rdx108 = or i1 %conflict.rdx104, %found.conflict107
  %bound0109 = icmp ult ptr %scevgep42, %scevgep46
  %bound1110 = icmp ult ptr %36, %scevgep43
  %found.conflict111 = and i1 %bound0109, %bound1110
  %conflict.rdx112 = or i1 %conflict.rdx108, %found.conflict111
  %bound0113 = icmp ult ptr %scevgep42, %scevgep48
  %bound1114 = icmp ult ptr %scevgep47, %scevgep43
  %found.conflict115 = and i1 %bound0113, %bound1114
  %conflict.rdx116 = or i1 %conflict.rdx112, %found.conflict115
  %bound0117 = icmp ult ptr %scevgep42, %34
  %bound1118 = icmp ugt ptr %scevgep43, %2
  %found.conflict119 = and i1 %bound0117, %bound1118
  %conflict.rdx120 = or i1 %conflict.rdx116, %found.conflict119
  %bound0121 = icmp ult ptr %scevgep42, %scevgep47
  %bound1122 = icmp ult ptr %35, %scevgep43
  %found.conflict123 = and i1 %bound0121, %bound1122
  %conflict.rdx124 = or i1 %conflict.rdx120, %found.conflict123
  br i1 %conflict.rdx124, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 4294967294
  %53 = load double, ptr %34, align 8, !tbaa !15, !alias.scope !17
  %broadcast.splatinsert126 = insertelement <2 x double> poison, double %53, i64 0
  %broadcast.splat127 = shufflevector <2 x double> %broadcast.splatinsert126, <2 x double> poison, <2 x i32> zeroinitializer
  %54 = load double, ptr %36, align 8, !tbaa !15, !alias.scope !20
  %broadcast.splatinsert = insertelement <2 x double> poison, double %54, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  %55 = fneg <2 x double> %broadcast.splat
  %56 = load double, ptr %2, align 8, !tbaa !15, !alias.scope !22
  %broadcast.splatinsert128 = insertelement <2 x double> poison, double %56, i64 0
  %broadcast.splat129 = shufflevector <2 x double> %broadcast.splatinsert128, <2 x double> poison, <2 x i32> zeroinitializer
  %57 = fneg <2 x double> %broadcast.splat129
  %58 = fneg <2 x double> %broadcast.splat127
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %59 = trunc i64 %index to i32
  %60 = add i32 %29, %59
  %61 = add i32 %33, %59
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %35, i64 %62
  %wide.load = load <2 x double>, ptr %63, align 8, !tbaa !15, !alias.scope !24
  %64 = zext i32 %60 to i64
  %65 = getelementptr inbounds double, ptr %35, i64 %64
  %wide.load125 = load <2 x double>, ptr %65, align 8, !tbaa !15, !alias.scope !26
  %66 = fmul <2 x double> %wide.load125, %55
  %67 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat127, <2 x double> %wide.load, <2 x double> %66)
  %68 = getelementptr inbounds double, ptr %35, i64 %index
  %wide.load130 = load <2 x double>, ptr %68, align 8, !tbaa !15, !alias.scope !28
  %69 = fmul <2 x double> %broadcast.splat, %wide.load130
  %70 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %57, <2 x double> %wide.load, <2 x double> %69)
  %71 = fmul <2 x double> %wide.load130, %58
  %72 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %broadcast.splat129, <2 x double> %wide.load125, <2 x double> %71)
  %73 = getelementptr inbounds double, ptr %37, i64 %index
  store <2 x double> %67, ptr %73, align 8, !tbaa !15, !alias.scope !30, !noalias !32
  %74 = getelementptr inbounds double, ptr %37, i64 %64
  store <2 x double> %70, ptr %74, align 8, !tbaa !15, !alias.scope !35, !noalias !36
  %75 = getelementptr inbounds double, ptr %37, i64 %62
  store <2 x double> %72, ptr %75, align 8, !tbaa !15, !alias.scope !37, !noalias !38
  %index.next = add nuw i64 %index, 2
  %76 = icmp eq i64 %index.next, %n.vec
  br i1 %76, label %middle.block, label %vector.body, !llvm.loop !39

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

77:                                               ; preds = %27
  %78 = load ptr, ptr @stderr, align 8, !tbaa !12
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.MatNd_columnCrossProduct, i32 noundef 2837, ptr noundef nonnull @.str.171) #6
  %80 = load ptr, ptr @stderr, align 8, !tbaa !12
  %81 = load i32, ptr %28, align 4, !tbaa !13
  %82 = load i32, ptr %30, align 4, !tbaa !13
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.172, i32 noundef %81, i32 noundef %82) #6
  %84 = load ptr, ptr @stderr, align 8, !tbaa !12
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.4) #6
  tail call void @print_trace() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %86 = trunc nuw i64 %indvars.iv to i32
  %87 = add i32 %29, %86
  %88 = add i32 %33, %86
  %89 = load double, ptr %34, align 8, !tbaa !15
  %90 = zext i32 %88 to i64
  %91 = getelementptr inbounds double, ptr %35, i64 %90
  %92 = load double, ptr %91, align 8, !tbaa !15
  %93 = load double, ptr %36, align 8, !tbaa !15
  %94 = zext i32 %87 to i64
  %95 = getelementptr inbounds double, ptr %35, i64 %94
  %96 = load double, ptr %95, align 8, !tbaa !15
  %97 = fneg double %93
  %98 = fmul double %96, %97
  %99 = tail call double @llvm.fmuladd.f64(double %89, double %92, double %98)
  %100 = load double, ptr %2, align 8, !tbaa !15
  %101 = fneg double %100
  %102 = getelementptr inbounds double, ptr %35, i64 %indvars.iv
  %103 = load double, ptr %102, align 8, !tbaa !15
  %104 = fmul double %93, %103
  %105 = tail call double @llvm.fmuladd.f64(double %101, double %92, double %104)
  %106 = fneg double %89
  %107 = fmul double %103, %106
  %108 = tail call double @llvm.fmuladd.f64(double %100, double %96, double %107)
  %109 = getelementptr inbounds double, ptr %37, i64 %indvars.iv
  store double %99, ptr %109, align 8, !tbaa !15
  %110 = getelementptr inbounds double, ptr %37, i64 %94
  store double %105, ptr %110, align 8, !tbaa !15
  %111 = getelementptr inbounds double, ptr %37, i64 %90
  store double %108, ptr %111, align 8, !tbaa !15
  %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 %._crit_edge, label %scalar.ph, !llvm.loop !43

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.preheader
  ret void
}

; 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>) #5

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 = { "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 = { noreturn 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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, !10, i64 8}
!6 = !{!"_MatNd", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 20}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 12}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = !{!23}
!23 = distinct !{!23, !19}
!24 = !{!25}
!25 = distinct !{!25, !19}
!26 = !{!27}
!27 = distinct !{!27, !19}
!28 = !{!29}
!29 = distinct !{!29, !19}
!30 = !{!31}
!31 = distinct !{!31, !19}
!32 = !{!33, !34, !18, !25, !21, !27, !23, !29}
!33 = distinct !{!33, !19}
!34 = distinct !{!34, !19}
!35 = !{!33}
!36 = !{!34, !18, !25, !21, !27, !23, !29}
!37 = !{!34}
!38 = !{!18, !25, !21, !27, !23, !29}
!39 = distinct !{!39, !40, !41, !42}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!"llvm.loop.isvectorized", i32 1}
!42 = !{!"llvm.loop.unroll.runtime.disable"}
!43 = distinct !{!43, !40, !41}


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