; LLVM IR from csviragh/robotsim :: src/utilities (math_utils)

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

@MultiplicateSquareMatrices.sum = external hidden global double, align 8

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

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local void @MultiplicateSquareMatrices(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store double 0.000000e+00, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %13 = load i32, ptr %8, align 4, !tbaa !9
  %14 = load i32, ptr %8, align 4, !tbaa !9
  %15 = call ptr @doubleMatrix(i32 noundef %13, i32 noundef %14)
  store ptr %15, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %68, %4
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = load i32, ptr %8, align 4, !tbaa !9
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %71

20:                                               ; preds = %16
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %64, %20
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %25, label %67

25:                                               ; preds = %21
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %51, %25
  %27 = load i32, ptr %11, align 4, !tbaa !9
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %54

30:                                               ; preds = %26
  %31 = load double, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !11
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !5
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %36, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds ptr, ptr %41, i64 %43
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds double, ptr %45, i64 %47
  %49 = load double, ptr %48, align 8, !tbaa !11
  %50 = call double @llvm.fmuladd.f64(double %40, double %49, double %31)
  store double %50, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !11
  br label %51

51:                                               ; preds = %30
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %11, align 4, !tbaa !9
  br label %26, !llvm.loop !13

54:                                               ; preds = %26
  %55 = load double, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !11
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds double, ptr %60, i64 %62
  store double %55, ptr %63, align 8, !tbaa !11
  store double 0.000000e+00, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !11
  br label %64

64:                                               ; preds = %54
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %10, align 4, !tbaa !9
  br label %21, !llvm.loop !15

67:                                               ; preds = %21
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %9, align 4, !tbaa !9
  br label %16, !llvm.loop !16

71:                                               ; preds = %16
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %72

72:                                               ; preds = %103, %71
  %73 = load i32, ptr %9, align 4, !tbaa !9
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %106

76:                                               ; preds = %72
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %99, %76
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %81, label %102

81:                                               ; preds = %77
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds ptr, ptr %82, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !11
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds double, ptr %95, i64 %97
  store double %90, ptr %98, align 8, !tbaa !11
  br label %99

99:                                               ; preds = %81
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %10, align 4, !tbaa !9
  br label %77, !llvm.loop !17

102:                                              ; preds = %77
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %9, align 4, !tbaa !9
  br label %72, !llvm.loop !18

106:                                              ; preds = %72
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = load i32, ptr %8, align 4, !tbaa !9
  call void @freeMatrix(ptr noundef %107, i32 noundef %108, i32 noundef %109)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret void
}

declare ptr @doubleMatrix(i32 noundef, i32 noundef) #3

declare void @freeMatrix(ptr noundef, i32 noundef, i32 noundef) #3

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@MultiplicateSquareMatrices.sum = external hidden local_unnamed_addr global double, align 8

; 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 void @MultiplicateSquareMatrices(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #1 {
  store double 0.000000e+00, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  %5 = tail call ptr @doubleMatrix(i32 noundef %3, i32 noundef %3) #3
  %6 = icmp sgt i32 %3, 0
  br i1 %6, label %.preheader40.us.preheader, label %._crit_edge47

.preheader40.us.preheader:                        ; preds = %4
  %wide.trip.count57 = zext nneg i32 %3 to i64
  %MultiplicateSquareMatrices.sum.promoted.us.us.pre.pre = load double, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  %xtraiter = and i64 %wide.trip.count57, 1
  %7 = icmp eq i32 %3, 1
  %unroll_iter = and i64 %wide.trip.count57, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader40.us

.preheader40.us:                                  ; preds = %.preheader40.us.preheader, %._crit_edge43.split.us.us
  %MultiplicateSquareMatrices.sum.promoted.us.us.pre = phi double [ %MultiplicateSquareMatrices.sum.promoted.us.us.pre.pre, %.preheader40.us.preheader ], [ 0.000000e+00, %._crit_edge43.split.us.us ]
  %indvars.iv54 = phi i64 [ 0, %.preheader40.us.preheader ], [ %indvars.iv.next55, %._crit_edge43.split.us.us ]
  %8 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv54
  %9 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv54
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = load ptr, ptr %8, align 8, !tbaa !9
  br label %.preheader39.us.us

.preheader39.us.us:                               ; preds = %._crit_edge.us.us, %.preheader40.us
  %MultiplicateSquareMatrices.sum.promoted.us.us = phi double [ 0.000000e+00, %._crit_edge.us.us ], [ %MultiplicateSquareMatrices.sum.promoted.us.us.pre, %.preheader40.us ]
  %indvars.iv49 = phi i64 [ %indvars.iv.next50, %._crit_edge.us.us ], [ 0, %.preheader40.us ]
  br i1 %7, label %._crit_edge.us.us.unr-lcssa, label %.preheader39.us.us.new

.preheader39.us.us.new:                           ; preds = %.preheader39.us.us, %.preheader39.us.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.preheader39.us.us.new ], [ 0, %.preheader39.us.us ]
  %12 = phi double [ %26, %.preheader39.us.us.new ], [ %MultiplicateSquareMatrices.sum.promoted.us.us, %.preheader39.us.us ]
  %niter = phi i64 [ %niter.next.1, %.preheader39.us.us.new ], [ 0, %.preheader39.us.us ]
  %13 = getelementptr inbounds double, ptr %11, i64 %indvars.iv
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds double, ptr %16, i64 %indvars.iv49
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = tail call double @llvm.fmuladd.f64(double %14, double %18, double %12)
  store double %19, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %20 = getelementptr inbounds double, ptr %11, i64 %indvars.iv.next
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv.next
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds double, ptr %23, i64 %indvars.iv49
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = tail call double @llvm.fmuladd.f64(double %21, double %25, double %19)
  store double %26, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.us.us.unr-lcssa, label %.preheader39.us.us.new, !llvm.loop !11

._crit_edge.us.us.unr-lcssa:                      ; preds = %.preheader39.us.us.new, %.preheader39.us.us
  %.lcssa.ph = phi double [ poison, %.preheader39.us.us ], [ %26, %.preheader39.us.us.new ]
  %indvars.iv.unr = phi i64 [ 0, %.preheader39.us.us ], [ %indvars.iv.next.1, %.preheader39.us.us.new ]
  %.unr = phi double [ %MultiplicateSquareMatrices.sum.promoted.us.us, %.preheader39.us.us ], [ %26, %.preheader39.us.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge.us.us, label %._crit_edge.us.us.epilog-lcssa

._crit_edge.us.us.epilog-lcssa:                   ; preds = %._crit_edge.us.us.unr-lcssa
  %27 = getelementptr inbounds double, ptr %11, i64 %indvars.iv.unr
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv.unr
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds double, ptr %30, i64 %indvars.iv49
  %32 = load double, ptr %31, align 8, !tbaa !5
  %33 = tail call double @llvm.fmuladd.f64(double %28, double %32, double %.unr)
  store double %33, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  br label %._crit_edge.us.us

._crit_edge.us.us:                                ; preds = %._crit_edge.us.us.unr-lcssa, %._crit_edge.us.us.epilog-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %._crit_edge.us.us.unr-lcssa ], [ %33, %._crit_edge.us.us.epilog-lcssa ]
  %34 = getelementptr inbounds double, ptr %10, i64 %indvars.iv49
  store double %.lcssa, ptr %34, align 8, !tbaa !5
  store double 0.000000e+00, ptr @MultiplicateSquareMatrices.sum, align 8, !tbaa !5
  %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
  %exitcond53.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count57
  br i1 %exitcond53.not, label %._crit_edge43.split.us.us, label %.preheader39.us.us, !llvm.loop !13

._crit_edge43.split.us.us:                        ; preds = %._crit_edge.us.us
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57
  br i1 %exitcond58.not, label %.preheader38, label %.preheader40.us, !llvm.loop !14

.preheader38:                                     ; preds = %._crit_edge43.split.us.us
  br i1 %6, label %.preheader.us.preheader, label %._crit_edge47

.preheader.us.preheader:                          ; preds = %.preheader38
  %wide.trip.count67 = zext nneg i32 %3 to i64
  %min.iters.check = icmp ult i32 %3, 4
  %n.vec = and i64 %wide.trip.count57, 2147483644
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count57
  %xtraiter75 = and i64 %wide.trip.count67, 3
  %lcmp.mod76.not = icmp eq i64 %xtraiter75, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv64 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next65, %._crit_edge.us ]
  %35 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv64
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv64
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = ptrtoint ptr %38 to i64
  %40 = ptrtoint ptr %36 to i64
  %41 = sub i64 %39, %40
  %diff.check = icmp ult i64 %41, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader.us ]
  %42 = getelementptr inbounds double, ptr %36, i64 %index
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  %wide.load = load <2 x double>, ptr %42, align 8, !tbaa !5
  %wide.load71 = load <2 x double>, ptr %43, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %38, i64 %index
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  store <2 x double> %wide.load, ptr %44, align 8, !tbaa !5
  store <2 x double> %wide.load71, ptr %45, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %46 = icmp eq i64 %index.next, %n.vec
  br i1 %46, label %middle.block, label %vector.body, !llvm.loop !15

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

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader.us
  %indvars.iv59.ph = phi i64 [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod76.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv59.prol = phi i64 [ %indvars.iv.next60.prol, %scalar.ph.prol ], [ %indvars.iv59.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %47 = getelementptr inbounds double, ptr %36, i64 %indvars.iv59.prol
  %48 = load double, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds double, ptr %38, i64 %indvars.iv59.prol
  store double %48, ptr %49, align 8, !tbaa !5
  %indvars.iv.next60.prol = add nuw nsw i64 %indvars.iv59.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter75
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !18

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv59.unr = phi i64 [ %indvars.iv59.ph, %scalar.ph.preheader ], [ %indvars.iv.next60.prol, %scalar.ph.prol ]
  %50 = sub nsw i64 %indvars.iv59.ph, %wide.trip.count67
  %51 = icmp ugt i64 %50, -4
  br i1 %51, label %._crit_edge.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv59 = phi i64 [ %indvars.iv.next60.3, %scalar.ph ], [ %indvars.iv59.unr, %scalar.ph.prol.loopexit ]
  %52 = getelementptr inbounds double, ptr %36, i64 %indvars.iv59
  %53 = load double, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds double, ptr %38, i64 %indvars.iv59
  store double %53, ptr %54, align 8, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %55 = getelementptr inbounds double, ptr %36, i64 %indvars.iv.next60
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %38, i64 %indvars.iv.next60
  store double %56, ptr %57, align 8, !tbaa !5
  %indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 2
  %58 = getelementptr inbounds double, ptr %36, i64 %indvars.iv.next60.1
  %59 = load double, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds double, ptr %38, i64 %indvars.iv.next60.1
  store double %59, ptr %60, align 8, !tbaa !5
  %indvars.iv.next60.2 = add nuw nsw i64 %indvars.iv59, 3
  %61 = getelementptr inbounds double, ptr %36, i64 %indvars.iv.next60.2
  %62 = load double, ptr %61, align 8, !tbaa !5
  %63 = getelementptr inbounds double, ptr %38, i64 %indvars.iv.next60.2
  store double %62, ptr %63, align 8, !tbaa !5
  %indvars.iv.next60.3 = add nuw nsw i64 %indvars.iv59, 4
  %exitcond63.not.3 = icmp eq i64 %indvars.iv.next60.3, %wide.trip.count67
  br i1 %exitcond63.not.3, label %._crit_edge.us, label %scalar.ph, !llvm.loop !20

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
  br i1 %exitcond68.not, label %._crit_edge47, label %.preheader.us, !llvm.loop !21

._crit_edge47:                                    ; preds = %._crit_edge.us, %4, %.preheader38
  tail call void @freeMatrix(ptr noundef %5, i32 noundef %3, i32 noundef %3) #3
  ret void
}

declare ptr @doubleMatrix(i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @freeMatrix(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #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 = { "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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !12, !16}
!21 = distinct !{!21, !12}


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