program main
   implicit none
   integer::N,C
   integer,allocatable,dimension(:,:)::D
   integer,allocatable,dimension(:,:)::Cs
   integer,allocatable,dimension(:,:)::T
   integer::i,j,k,m
   integer::ans,preans
   read*,N,C
   allocate(D(C,C))
   do i=1,C
      read*,D(i,:)
   end do
   allocate(Cs(N,N))
   do i=1,N
      read*,Cs(i,:)
   end do

   allocate(T(0:2,C))
   T=0
   do i=1,N
      do j=1,N
         T(mod(i+j,3),Cs(i,j))=T(mod(i+j,3),Cs(i,j))+1
      end do
   end do
   
   ans=huge(ans)
   do i=1,C
      do j=1,C
         do k=1,C
            if((i-j)*(j-k)*(k-i)==0)cycle
            preans=0
            do m=1,C
               preans=preans+D(m,i)*T(0,m)+D(m,j)*T(1,m)+D(m,k)*T(2,m)
            end do
            ans=min(ans,preans)
         end do
      end do
   end do
   print"(I0)",ANS
contains

end program main
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QFEcs.0 = internal unnamed_addr global ptr null
@_QFEcs.8 = internal unnamed_addr global i64 0
@_QFEcs.11 = internal unnamed_addr global i64 0
@_QFEd.0 = internal unnamed_addr global ptr null
@_QFEd.8 = internal unnamed_addr global i64 0
@_QFEd.11 = internal unnamed_addr global i64 0
@_QFEt.0 = internal unnamed_addr global ptr null
@_QFEt.10 = internal unnamed_addr global i64 1
@_QQcl.54ce62287d7060f7c97779d20ef507d3 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5916/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_QQcl.28493029 = linkonce constant [4 x i8] c"(I0)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.54ce62287d7060f7c97779d20ef507d3, i32 9)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %9 = load i32, ptr %3, align 4, !tbaa !3
  %10 = call i32 @llvm.smax.i32(i32 %9, i32 0)
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %11, 2
  %13 = mul nuw i64 %12, %11
  %14 = call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEd.0, align 8, !tbaa !7
  store i64 %11, ptr @_QFEd.8, align 8, !tbaa !7
  store i64 %11, ptr @_QFEd.11, align 8, !tbaa !7
  %15 = icmp sgt i32 %9, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %16 = zext i32 %9 to i64
  %.fca.1.gep419 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep421 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep423 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep425 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep427 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep429 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep431 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep433 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep435 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  br label %17

17:                                               ; preds = %.lr.ph, %17
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %17 ]
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.54ce62287d7060f7c97779d20ef507d3, i32 12)
  %.unpack588 = load ptr, ptr @_QFEd.0, align 8, !tbaa !7
  %.unpack595.unpack.unpack598 = load i64, ptr @_QFEd.8, align 8, !tbaa !7
  %.unpack595.unpack596.unpack601 = load i64, ptr @_QFEd.11, align 8, !tbaa !7
  %19 = add nsw i64 %indvars.iv, -1
  %20 = shl i64 %.unpack595.unpack.unpack598, 2
  %21 = call i64 @llvm.smax.i64(i64 %.unpack595.unpack596.unpack601, i64 0)
  %22 = getelementptr i32, ptr %.unpack588, i64 %19
  store ptr %22, ptr %1, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep419, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep421, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep423, align 4, !tbaa !7
  store i8 9, ptr %.fca.4.gep425, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep427, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep429, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep431, align 8, !tbaa !7
  store i64 %21, ptr %.fca.7.0.1.gep433, align 8, !tbaa !7
  store i64 %20, ptr %.fca.7.0.2.gep435, align 8, !tbaa !7
  %23 = call i1 @_FortranAioInputDescriptor(ptr %18, ptr nonnull %1)
  %24 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %16
  br i1 %exitcond.not, label %._crit_edge, label %17

._crit_edge:                                      ; preds = %17, %0
  %25 = load i32, ptr %4, align 4, !tbaa !3
  %26 = call i32 @llvm.smax.i32(i32 %25, i32 0)
  %27 = zext i32 %26 to i64
  %28 = shl nuw nsw i64 %27, 2
  %29 = mul nuw i64 %28, %27
  %30 = call ptr @malloc(i64 %29)
  store ptr %30, ptr @_QFEcs.0, align 8, !tbaa !7
  store i64 %27, ptr @_QFEcs.8, align 8, !tbaa !7
  store i64 %27, ptr @_QFEcs.11, align 8, !tbaa !7
  %31 = icmp sgt i32 %25, 0
  br i1 %31, label %.lr.ph609, label %._crit_edge610

.lr.ph609:                                        ; preds = %._crit_edge
  %32 = zext i32 %25 to i64
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  br label %33

33:                                               ; preds = %.lr.ph609, %33
  %indvars.iv651 = phi i64 [ 1, %.lr.ph609 ], [ %indvars.iv.next652, %33 ]
  %34 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.54ce62287d7060f7c97779d20ef507d3, i32 16)
  %.unpack572 = load ptr, ptr @_QFEcs.0, align 8, !tbaa !7
  %.unpack579.unpack.unpack582 = load i64, ptr @_QFEcs.8, align 8, !tbaa !7
  %.unpack579.unpack580.unpack585 = load i64, ptr @_QFEcs.11, align 8, !tbaa !7
  %35 = add nsw i64 %indvars.iv651, -1
  %36 = shl i64 %.unpack579.unpack.unpack582, 2
  %37 = call i64 @llvm.smax.i64(i64 %.unpack579.unpack580.unpack585, i64 0)
  %38 = getelementptr i32, ptr %.unpack572, i64 %35
  store ptr %38, ptr %2, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  store i64 %37, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 %36, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %39 = call i1 @_FortranAioInputDescriptor(ptr %34, ptr nonnull %2)
  %40 = call i32 @_FortranAioEndIoStatement(ptr %34)
  %indvars.iv.next652 = add nuw nsw i64 %indvars.iv651, 1
  %exitcond654.not = icmp eq i64 %indvars.iv651, %32
  br i1 %exitcond654.not, label %._crit_edge610, label %33

._crit_edge610:                                   ; preds = %33, %._crit_edge
  %41 = load i32, ptr %3, align 4, !tbaa !3
  %42 = call i32 @llvm.smax.i32(i32 %41, i32 0)
  %43 = zext i32 %42 to i64
  %44 = mul nuw nsw i64 %43, 12
  %45 = call ptr @malloc(i64 %44)
  %46 = icmp slt i32 %41, 1
  store ptr %45, ptr @_QFEt.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEt.10, align 8, !tbaa !7
  %.not = icmp eq ptr %45, null
  br i1 %.not, label %49, label %.preheader607

.preheader607:                                    ; preds = %._crit_edge610
  br i1 %46, label %._crit_edge611, label %.preheader606.preheader

.preheader606.preheader:                          ; preds = %.preheader607
  %47 = call i64 @llvm.smin.i64(i64 %43, i64 1)
  %.neg = mul nuw nsw i64 %47, -12
  %.neg681 = add nsw i64 %.neg, 12
  %48 = add nuw nsw i64 %.neg681, %44
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %45, i8 0, i64 %48, i1 false), !tbaa !3
  br label %._crit_edge611

49:                                               ; preds = %._crit_edge610
  %50 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.54ce62287d7060f7c97779d20ef507d3, i32 20)
  %.unpack551.unpack552.unpack.pre = load i64, ptr @_QFEt.10, align 8, !tbaa !7
  %51 = select i1 %46, i64 1, i64 %.unpack551.unpack552.unpack.pre
  store ptr %45, ptr @_QFEt.0, align 8, !tbaa !7
  store i64 %51, ptr @_QFEt.10, align 8, !tbaa !7
  br label %._crit_edge611

._crit_edge611:                                   ; preds = %.preheader607, %.preheader606.preheader, %49
  %.unpack503.unpack504.unpack = phi i64 [ %51, %49 ], [ 1, %.preheader606.preheader ], [ 1, %.preheader607 ]
  %52 = load i32, ptr %4, align 4, !tbaa !3
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph616, label %._crit_edge617

.lr.ph616:                                        ; preds = %._crit_edge611
  %54 = zext i32 %52 to i64
  %.unpack528 = load ptr, ptr @_QFEcs.0, align 8
  %.unpack535.unpack.unpack538 = load i64, ptr @_QFEcs.8, align 8
  br label %.lr.ph613

.lr.ph613:                                        ; preds = %._crit_edge614, %.lr.ph616
  %indvars.iv659 = phi i64 [ 1, %.lr.ph616 ], [ %indvars.iv.next660, %._crit_edge614 ]
  %55 = add nsw i64 %indvars.iv659, -1
  br label %56

56:                                               ; preds = %.lr.ph613, %56
  %indvars.iv655 = phi i64 [ 1, %.lr.ph613 ], [ %indvars.iv.next656, %56 ]
  %57 = add nuw nsw i64 %indvars.iv655, %indvars.iv659
  %58 = trunc i64 %57 to i32
  %59 = srem i32 %58, 3
  %60 = sext i32 %59 to i64
  %61 = add nsw i64 %indvars.iv655, -1
  %62 = mul i64 %61, %.unpack535.unpack.unpack538
  %63 = add i64 %55, %62
  %64 = getelementptr i32, ptr %.unpack528, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !3
  %66 = sext i32 %65 to i64
  %67 = sub i64 %66, %.unpack503.unpack504.unpack
  %68 = mul i64 %67, 3
  %69 = add i64 %68, %60
  %70 = getelementptr i32, ptr %45, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !3
  %72 = add i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !3
  %indvars.iv.next656 = add nuw nsw i64 %indvars.iv655, 1
  %exitcond658.not = icmp eq i64 %indvars.iv655, %54
  br i1 %exitcond658.not, label %._crit_edge614, label %56

._crit_edge614:                                   ; preds = %56
  %indvars.iv.next660 = add nuw nsw i64 %indvars.iv659, 1
  %exitcond662.not = icmp eq i64 %indvars.iv659, %54
  br i1 %exitcond662.not, label %._crit_edge617, label %.lr.ph613

._crit_edge617:                                   ; preds = %._crit_edge614, %._crit_edge611
  %73 = load i32, ptr %3, align 4, !tbaa !3
  %74 = sext i32 %73 to i64
  %75 = icmp sgt i32 %73, 0
  br i1 %75, label %.preheader605.us.us.us.preheader, label %._crit_edge637

.preheader605.us.us.us.preheader:                 ; preds = %._crit_edge617
  %.unpack = load ptr, ptr @_QFEd.0, align 8
  %.unpack487.unpack.unpack490 = load i64, ptr @_QFEd.8, align 8
  %min.iters.check = icmp ult i32 %73, 8
  %n.vec = and i64 %74, -8
  %ind.end = or i64 %n.vec, 1
  %cmp.n = icmp eq i64 %n.vec, %74
  br label %.preheader605.us.us.us

.preheader605.us.us.us:                           ; preds = %.preheader605.us.us.us.preheader, %._crit_edge626.split.us.split.us.us.us.us
  %indvars.iv675 = phi i64 [ 1, %.preheader605.us.us.us.preheader ], [ %indvars.iv.next676, %._crit_edge626.split.us.split.us.us.us.us ]
  %.0436636.us.us.us = phi i32 [ 2147483647, %.preheader605.us.us.us.preheader ], [ %.3.us.us.us.us.us.us, %._crit_edge626.split.us.split.us.us.us.us ]
  %76 = add nsw i64 %indvars.iv675, -1
  %77 = mul i64 %76, %.unpack487.unpack.unpack490
  %78 = trunc i64 %indvars.iv675 to i32
  br label %.preheader604.us.us.us.us.us

.preheader604.us.us.us.us.us:                     ; preds = %._crit_edge623.split.us.us.us.us.us.us, %.preheader605.us.us.us
  %indvars.iv671 = phi i64 [ %indvars.iv.next672, %._crit_edge623.split.us.us.us.us.us.us ], [ 1, %.preheader605.us.us.us ]
  %.1625.us.us.us.us.us = phi i32 [ %.3.us.us.us.us.us.us, %._crit_edge623.split.us.us.us.us.us.us ], [ %.0436636.us.us.us, %.preheader605.us.us.us ]
  %79 = sub nsw i64 %indvars.iv675, %indvars.iv671
  %80 = add nsw i64 %indvars.iv671, -1
  %81 = mul i64 %80, %.unpack487.unpack.unpack490
  %82 = trunc i64 %79 to i32
  br label %83

83:                                               ; preds = %115, %.preheader604.us.us.us.us.us
  %indvars.iv667 = phi i64 [ %indvars.iv.next668, %115 ], [ 1, %.preheader604.us.us.us.us.us ]
  %.2621.us.us.us.us.us.us = phi i32 [ %.3.us.us.us.us.us.us, %115 ], [ %.1625.us.us.us.us.us, %.preheader604.us.us.us.us.us ]
  %indvars669 = trunc i64 %indvars.iv667 to i32
  %84 = sub nsw i64 %indvars.iv671, %indvars.iv667
  %85 = trunc i64 %84 to i32
  %86 = mul i32 %85, %82
  %87 = sub nsw i32 %indvars669, %78
  %88 = mul i32 %86, %87
  %.not480.us.us.us.us.us.us = icmp eq i32 %88, 0
  br i1 %.not480.us.us.us.us.us.us, label %115, label %.preheader.us.us.us.us.us.us

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv663 = phi i64 [ %indvars.iv.next664, %scalar.ph ], [ %indvars.iv663.ph, %scalar.ph.preheader ]
  %.0618.us.us.us.us.us.us = phi i32 [ %114, %scalar.ph ], [ %.0618.us.us.us.us.us.us.ph, %scalar.ph.preheader ]
  %89 = add i64 %indvars.iv663, -1
  %90 = add i64 %77, %89
  %91 = getelementptr i32, ptr %.unpack, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !3
  %93 = sub i64 %indvars.iv663, %.unpack503.unpack504.unpack
  %94 = mul i64 %93, 3
  %95 = getelementptr i32, ptr %45, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !3
  %97 = mul i32 %96, %92
  %98 = add i32 %97, %.0618.us.us.us.us.us.us
  %99 = add i64 %81, %89
  %100 = getelementptr i32, ptr %.unpack, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !3
  %102 = add i64 %94, 1
  %103 = getelementptr i32, ptr %45, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !3
  %105 = mul i32 %104, %101
  %106 = add i32 %98, %105
  %107 = add i64 %117, %89
  %108 = getelementptr i32, ptr %.unpack, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !3
  %110 = add i64 %94, 2
  %111 = getelementptr i32, ptr %45, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !3
  %113 = mul i32 %112, %109
  %114 = add i32 %106, %113
  %indvars.iv.next664 = add nuw nsw i64 %indvars.iv663, 1
  %exitcond666.not = icmp eq i64 %indvars.iv663, %74
  br i1 %exitcond666.not, label %._crit_edge620.us.us.us.us.us.us, label %scalar.ph, !llvm.loop !9

115:                                              ; preds = %._crit_edge620.us.us.us.us.us.us, %83
  %.3.us.us.us.us.us.us = phi i32 [ %148, %._crit_edge620.us.us.us.us.us.us ], [ %.2621.us.us.us.us.us.us, %83 ]
  %indvars.iv.next668 = add nuw nsw i64 %indvars.iv667, 1
  %exitcond670.not = icmp eq i64 %indvars.iv667, %74
  br i1 %exitcond670.not, label %._crit_edge623.split.us.us.us.us.us.us, label %83

.preheader.us.us.us.us.us.us:                     ; preds = %83
  %116 = add nsw i64 %indvars.iv667, -1
  %117 = mul i64 %116, %.unpack487.unpack.unpack490
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader.us.us.us.us.us.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader.us.us.us.us.us.us ]
  %vec.phi = phi <4 x i32> [ %144, %vector.body ], [ zeroinitializer, %.preheader.us.us.us.us.us.us ]
  %vec.phi682 = phi <4 x i32> [ %145, %vector.body ], [ zeroinitializer, %.preheader.us.us.us.us.us.us ]
  %offset.idx = or i64 %index, 1
  %118 = or i64 %index, 5
  %119 = add i64 %77, %index
  %120 = getelementptr i32, ptr %.unpack, i64 %119
  %wide.load = load <4 x i32>, ptr %120, align 4, !tbaa !3
  %121 = getelementptr i32, ptr %120, i64 4
  %wide.load683 = load <4 x i32>, ptr %121, align 4, !tbaa !3
  %122 = sub i64 %offset.idx, %.unpack503.unpack504.unpack
  %123 = sub i64 %118, %.unpack503.unpack504.unpack
  %124 = mul i64 %122, 3
  %125 = mul i64 %123, 3
  %126 = getelementptr i32, ptr %45, i64 %124
  %127 = getelementptr i32, ptr %45, i64 %125
  %wide.vec = load <12 x i32>, ptr %126, align 4, !tbaa !3
  %wide.vec684 = load <12 x i32>, ptr %127, align 4, !tbaa !3
  %strided.vec = shufflevector <12 x i32> %wide.vec, <12 x i32> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
  %strided.vec685 = shufflevector <12 x i32> %wide.vec684, <12 x i32> poison, <4 x i32> <i32 0, i32 3, i32 6, i32 9>
  %strided.vec686 = shufflevector <12 x i32> %wide.vec, <12 x i32> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
  %strided.vec687 = shufflevector <12 x i32> %wide.vec684, <12 x i32> poison, <4 x i32> <i32 1, i32 4, i32 7, i32 10>
  %strided.vec688 = shufflevector <12 x i32> %wide.vec, <12 x i32> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
  %strided.vec689 = shufflevector <12 x i32> %wide.vec684, <12 x i32> poison, <4 x i32> <i32 2, i32 5, i32 8, i32 11>
  %128 = mul <4 x i32> %strided.vec, %wide.load
  %129 = mul <4 x i32> %strided.vec685, %wide.load683
  %130 = add <4 x i32> %128, %vec.phi
  %131 = add <4 x i32> %129, %vec.phi682
  %132 = add i64 %81, %index
  %133 = getelementptr i32, ptr %.unpack, i64 %132
  %wide.load690 = load <4 x i32>, ptr %133, align 4, !tbaa !3
  %134 = getelementptr i32, ptr %133, i64 4
  %wide.load691 = load <4 x i32>, ptr %134, align 4, !tbaa !3
  %135 = mul <4 x i32> %strided.vec686, %wide.load690
  %136 = mul <4 x i32> %strided.vec687, %wide.load691
  %137 = add <4 x i32> %130, %135
  %138 = add <4 x i32> %131, %136
  %139 = add i64 %117, %index
  %140 = getelementptr i32, ptr %.unpack, i64 %139
  %wide.load692 = load <4 x i32>, ptr %140, align 4, !tbaa !3
  %141 = getelementptr i32, ptr %140, i64 4
  %wide.load693 = load <4 x i32>, ptr %141, align 4, !tbaa !3
  %142 = mul <4 x i32> %strided.vec688, %wide.load692
  %143 = mul <4 x i32> %strided.vec689, %wide.load693
  %144 = add <4 x i32> %137, %142
  %145 = add <4 x i32> %138, %143
  %index.next = add nuw i64 %index, 8
  %146 = icmp eq i64 %index.next, %n.vec
  br i1 %146, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %145, %144
  %147 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge620.us.us.us.us.us.us, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.preheader.us.us.us.us.us.us, %middle.block
  %indvars.iv663.ph = phi i64 [ 1, %.preheader.us.us.us.us.us.us ], [ %ind.end, %middle.block ]
  %.0618.us.us.us.us.us.us.ph = phi i32 [ 0, %.preheader.us.us.us.us.us.us ], [ %147, %middle.block ]
  br label %scalar.ph

._crit_edge620.us.us.us.us.us.us:                 ; preds = %scalar.ph, %middle.block
  %.lcssa = phi i32 [ %147, %middle.block ], [ %114, %scalar.ph ]
  %148 = call i32 @llvm.smin.i32(i32 %.2621.us.us.us.us.us.us, i32 %.lcssa)
  br label %115

._crit_edge623.split.us.us.us.us.us.us:           ; preds = %115
  %indvars.iv.next672 = add nuw nsw i64 %indvars.iv671, 1
  %exitcond674.not = icmp eq i64 %indvars.iv671, %74
  br i1 %exitcond674.not, label %._crit_edge626.split.us.split.us.us.us.us, label %.preheader604.us.us.us.us.us

._crit_edge626.split.us.split.us.us.us.us:        ; preds = %._crit_edge623.split.us.us.us.us.us.us
  %indvars.iv.next676 = add nuw nsw i64 %indvars.iv675, 1
  %exitcond678.not = icmp eq i64 %indvars.iv675, %74
  br i1 %exitcond678.not, label %._crit_edge637, label %.preheader605.us.us.us

._crit_edge637:                                   ; preds = %._crit_edge626.split.us.split.us.us.us.us, %._crit_edge617
  %.0436.lcssa = phi i32 [ 2147483647, %._crit_edge617 ], [ %.3.us.us.us.us.us.us, %._crit_edge626.split.us.split.us.us.us.us ]
  %149 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28493029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.54ce62287d7060f7c97779d20ef507d3, i32 40)
  %150 = call i1 @_FortranAioOutputInteger32(ptr %149, i32 %.0436.lcssa)
  %151 = call i32 @_FortranAioEndIoStatement(ptr %149)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(none) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = distinct !{!12, !11, !10}
