program Wall
    implicit none
    integer(4):: h,w,c(0:9,0:9), changer(0:9)
    integer(4):: i,j,ans
    integer(4),allocatable:: a(:,:)

    read*, h,w

    do i=0,9
        read*, c(:,i)
    end do

    allocate(a(w,h))

    do i=1,h
        read*, a(:,i)
    end do

    call warf(c)

    changer(0:9) = c(1,0:9)

    ans=0
    do i=1,h
        do j=1,w
            if (a(j,i) == -1) cycle
            ans = ans + changer(a(j,i))
        end do
    end do
    print*, ans
contains
    subroutine warf(det)
        integer(4):: det(:,:)
        integer(4):: i,j,k,l
        
        l = size(det,dim=1)
        do k=1,l
            do i=1,l
                do j=1,l
                    det(i,j) = min(det(i,j), det(i,k)+det(k,j))
                end do
            end do
        end do
    end subroutine
end program Wall
; 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"

@_QFEa.0 = internal unnamed_addr global ptr null
@_QFEa.8 = internal unnamed_addr global i64 0
@_QFEc = internal global [10 x [10 x i32]] undef
@_QFEchanger = internal unnamed_addr global [10 x i32] undef
@_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6715/source.f\00"
@_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.ad0f666a320dc49d0c7f9c0eea6e457c, i32 7)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %3, i32 4)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %8 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %.fca.1.gep162 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep164 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep166 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep168 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep170 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep172 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep174 = 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.gep176 = 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.gep178 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %9 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr @_QFEc, ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %10 = call i1 @_FortranAioInputDescriptor(ptr %9, ptr nonnull %1)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 1, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %13 = call i1 @_FortranAioInputDescriptor(ptr %12, ptr nonnull %1)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 2, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %16 = call i1 @_FortranAioInputDescriptor(ptr %15, ptr nonnull %1)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 3, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %19 = call i1 @_FortranAioInputDescriptor(ptr %18, ptr nonnull %1)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %21 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 4, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %22 = call i1 @_FortranAioInputDescriptor(ptr %21, ptr nonnull %1)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %21)
  %24 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 5, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %25 = call i1 @_FortranAioInputDescriptor(ptr %24, ptr nonnull %1)
  %26 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %27 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 6, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %28 = call i1 @_FortranAioInputDescriptor(ptr %27, ptr nonnull %1)
  %29 = call i32 @_FortranAioEndIoStatement(ptr %27)
  %30 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 7, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %31 = call i1 @_FortranAioInputDescriptor(ptr %30, ptr nonnull %1)
  %32 = call i32 @_FortranAioEndIoStatement(ptr %30)
  %33 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 8, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %34 = call i1 @_FortranAioInputDescriptor(ptr %33, ptr nonnull %1)
  %35 = call i32 @_FortranAioEndIoStatement(ptr %33)
  %36 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 10)
  store ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 9, i64 0), ptr %1, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep162, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep164, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep166, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep168, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep170, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep172, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep174, align 8, !tbaa !3
  store i64 10, ptr %.fca.7.0.1.gep176, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep178, align 8, !tbaa !3
  %37 = call i1 @_FortranAioInputDescriptor(ptr %36, ptr nonnull %1)
  %38 = call i32 @_FortranAioEndIoStatement(ptr %36)
  %39 = load i32, ptr %4, align 4, !tbaa !7
  %40 = load i32, ptr %3, align 4, !tbaa !7
  %41 = call i32 @llvm.smax.i32(i32 %39, i32 0)
  %42 = zext i32 %41 to i64
  %43 = call i32 @llvm.smax.i32(i32 %40, i32 0)
  %44 = zext i32 %43 to i64
  %45 = shl nuw nsw i64 %42, 2
  %46 = mul nuw i64 %45, %44
  %47 = call ptr @malloc(i64 %46)
  store ptr %47, ptr @_QFEa.0, align 8, !tbaa !3
  store i64 %42, ptr @_QFEa.8, align 8, !tbaa !3
  %48 = icmp sgt i32 %40, 0
  br i1 %48, label %.lr.ph, label %.preheader11.us.us.i.preheader

.lr.ph:                                           ; preds = %0
  %49 = zext i32 %40 to i64
  %.fca.1.gep142 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  %.fca.2.gep144 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 2
  %.fca.3.gep146 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 3
  %.fca.4.gep148 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  %.fca.5.gep150 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 5
  %.fca.6.gep152 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 6
  %.fca.7.0.0.gep154 = 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.gep156 = 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.gep158 = 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 %50

50:                                               ; preds = %.lr.ph, %50
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %50 ]
  %51 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 16)
  %.unpack212 = load ptr, ptr @_QFEa.0, align 8, !tbaa !3
  %.unpack219.unpack.unpack222 = load i64, ptr @_QFEa.8, align 8, !tbaa !3
  %52 = call i64 @llvm.smax.i64(i64 %.unpack219.unpack.unpack222, i64 0)
  %53 = add nsw i64 %indvars.iv, -1
  %54 = mul i64 %53, %.unpack219.unpack.unpack222
  %55 = getelementptr i32, ptr %.unpack212, i64 %54
  store ptr %55, ptr %2, align 8, !tbaa !3
  store i64 4, ptr %.fca.1.gep142, align 8, !tbaa !3
  store i32 20180515, ptr %.fca.2.gep144, align 8, !tbaa !3
  store i8 1, ptr %.fca.3.gep146, align 4, !tbaa !3
  store i8 9, ptr %.fca.4.gep148, align 1, !tbaa !3
  store i8 0, ptr %.fca.5.gep150, align 2, !tbaa !3
  store i8 0, ptr %.fca.6.gep152, align 1, !tbaa !3
  store i64 1, ptr %.fca.7.0.0.gep154, align 8, !tbaa !3
  store i64 %52, ptr %.fca.7.0.1.gep156, align 8, !tbaa !3
  store i64 4, ptr %.fca.7.0.2.gep158, align 8, !tbaa !3
  %56 = call i1 @_FortranAioInputDescriptor(ptr %51, ptr nonnull %2)
  %57 = call i32 @_FortranAioEndIoStatement(ptr %51)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %49
  br i1 %exitcond.not, label %.preheader11.us.us.i.preheader, label %50

.preheader11.us.us.i.preheader:                   ; preds = %50, %0
  br label %.preheader11.us.us.i

.preheader11.us.us.i:                             ; preds = %.preheader11.us.us.i.preheader, %._crit_edge12.split.us.us.us.i
  %indvars.iv20.i = phi i64 [ %indvars.iv.next21.i, %._crit_edge12.split.us.us.us.i ], [ 1, %.preheader11.us.us.i.preheader ]
  %58 = add nsw i64 %indvars.iv20.i, -1
  %59 = mul nuw nsw i64 %58, 40
  %60 = shl i64 %58, 2
  %61 = getelementptr i8, ptr @_QFEc, i64 %60
  %62 = add nuw nsw i64 %60, 40
  %63 = getelementptr i8, ptr @_QFEc, i64 %62
  %64 = add nuw nsw i64 %60, 80
  %65 = getelementptr i8, ptr @_QFEc, i64 %64
  %66 = add nuw nsw i64 %60, 120
  %67 = getelementptr i8, ptr @_QFEc, i64 %66
  %68 = add nuw nsw i64 %60, 160
  %69 = getelementptr i8, ptr @_QFEc, i64 %68
  %70 = add nuw nsw i64 %60, 200
  %71 = getelementptr i8, ptr @_QFEc, i64 %70
  %72 = add nuw nsw i64 %60, 240
  %73 = getelementptr i8, ptr @_QFEc, i64 %72
  %74 = add nuw nsw i64 %60, 280
  %75 = getelementptr i8, ptr @_QFEc, i64 %74
  %76 = add nuw nsw i64 %60, 320
  %77 = getelementptr i8, ptr @_QFEc, i64 %76
  %78 = add nuw nsw i64 %60, 360
  %79 = getelementptr i8, ptr @_QFEc, i64 %78
  br label %.preheader.us.us.us.i

.preheader.us.us.us.i:                            ; preds = %.preheader.us.us.us.i, %.preheader11.us.us.i
  %indvars.iv17.i = phi i64 [ %indvars.iv.next18.i, %.preheader.us.us.us.i ], [ 1, %.preheader11.us.us.i ]
  %80 = shl i64 %indvars.iv17.i, 2
  %81 = add nsw i64 %80, -4
  %82 = add nuw nsw i64 %81, %59
  %83 = getelementptr i8, ptr @_QFEc, i64 %82
  %84 = getelementptr i8, ptr @_QFEc, i64 %81
  %85 = load i32, ptr %84, align 4, !tbaa !7
  %86 = load i32, ptr %83, align 4, !tbaa !7
  %87 = load i32, ptr %61, align 4, !tbaa !7
  %88 = add i32 %87, %86
  %89 = call i32 @llvm.smin.i32(i32 %85, i32 %88)
  store i32 %89, ptr %84, align 4, !tbaa !7
  %90 = add nsw i64 %80, 36
  %91 = getelementptr i8, ptr @_QFEc, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !7
  %93 = load i32, ptr %83, align 4, !tbaa !7
  %94 = load i32, ptr %63, align 4, !tbaa !7
  %95 = add i32 %94, %93
  %96 = call i32 @llvm.smin.i32(i32 %92, i32 %95)
  store i32 %96, ptr %91, align 4, !tbaa !7
  %97 = add nsw i64 %80, 76
  %98 = getelementptr i8, ptr @_QFEc, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !7
  %100 = load i32, ptr %83, align 4, !tbaa !7
  %101 = load i32, ptr %65, align 4, !tbaa !7
  %102 = add i32 %101, %100
  %103 = call i32 @llvm.smin.i32(i32 %99, i32 %102)
  store i32 %103, ptr %98, align 4, !tbaa !7
  %104 = add nsw i64 %80, 116
  %105 = getelementptr i8, ptr @_QFEc, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !7
  %107 = load i32, ptr %83, align 4, !tbaa !7
  %108 = load i32, ptr %67, align 4, !tbaa !7
  %109 = add i32 %108, %107
  %110 = call i32 @llvm.smin.i32(i32 %106, i32 %109)
  store i32 %110, ptr %105, align 4, !tbaa !7
  %111 = add nsw i64 %80, 156
  %112 = getelementptr i8, ptr @_QFEc, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !7
  %114 = load i32, ptr %83, align 4, !tbaa !7
  %115 = load i32, ptr %69, align 4, !tbaa !7
  %116 = add i32 %115, %114
  %117 = call i32 @llvm.smin.i32(i32 %113, i32 %116)
  store i32 %117, ptr %112, align 4, !tbaa !7
  %118 = add nsw i64 %80, 196
  %119 = getelementptr i8, ptr @_QFEc, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !7
  %121 = load i32, ptr %83, align 4, !tbaa !7
  %122 = load i32, ptr %71, align 4, !tbaa !7
  %123 = add i32 %122, %121
  %124 = call i32 @llvm.smin.i32(i32 %120, i32 %123)
  store i32 %124, ptr %119, align 4, !tbaa !7
  %125 = add nsw i64 %80, 236
  %126 = getelementptr i8, ptr @_QFEc, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !7
  %128 = load i32, ptr %83, align 4, !tbaa !7
  %129 = load i32, ptr %73, align 4, !tbaa !7
  %130 = add i32 %129, %128
  %131 = call i32 @llvm.smin.i32(i32 %127, i32 %130)
  store i32 %131, ptr %126, align 4, !tbaa !7
  %132 = add nsw i64 %80, 276
  %133 = getelementptr i8, ptr @_QFEc, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !7
  %135 = load i32, ptr %83, align 4, !tbaa !7
  %136 = load i32, ptr %75, align 4, !tbaa !7
  %137 = add i32 %136, %135
  %138 = call i32 @llvm.smin.i32(i32 %134, i32 %137)
  store i32 %138, ptr %133, align 4, !tbaa !7
  %139 = add nsw i64 %80, 316
  %140 = getelementptr i8, ptr @_QFEc, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !7
  %142 = load i32, ptr %83, align 4, !tbaa !7
  %143 = load i32, ptr %77, align 4, !tbaa !7
  %144 = add i32 %143, %142
  %145 = call i32 @llvm.smin.i32(i32 %141, i32 %144)
  store i32 %145, ptr %140, align 4, !tbaa !7
  %146 = add nsw i64 %80, 356
  %147 = getelementptr i8, ptr @_QFEc, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !7
  %149 = load i32, ptr %83, align 4, !tbaa !7
  %150 = load i32, ptr %79, align 4, !tbaa !7
  %151 = add i32 %150, %149
  %152 = call i32 @llvm.smin.i32(i32 %148, i32 %151)
  store i32 %152, ptr %147, align 4, !tbaa !7
  %indvars.iv.next18.i = add nuw nsw i64 %indvars.iv17.i, 1
  %exitcond239.not = icmp eq i64 %indvars.iv.next18.i, 11
  br i1 %exitcond239.not, label %._crit_edge12.split.us.us.us.i, label %.preheader.us.us.us.i

._crit_edge12.split.us.us.us.i:                   ; preds = %.preheader.us.us.us.i
  %indvars.iv.next21.i = add nuw nsw i64 %indvars.iv20.i, 1
  %exitcond240.not = icmp eq i64 %indvars.iv.next21.i, 11
  br i1 %exitcond240.not, label %_QFPwarf.exit.preheader, label %.preheader11.us.us.i

_QFPwarf.exit.preheader:                          ; preds = %._crit_edge12.split.us.us.us.i
  %153 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 0, i64 1), align 4, !tbaa !7
  store i32 %153, ptr @_QFEchanger, align 16, !tbaa !7
  %154 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 1, i64 1), align 4, !tbaa !7
  store i32 %154, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 1), align 4, !tbaa !7
  %155 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 2, i64 1), align 4, !tbaa !7
  store i32 %155, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 2), align 8, !tbaa !7
  %156 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 3, i64 1), align 4, !tbaa !7
  store i32 %156, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 3), align 4, !tbaa !7
  %157 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 4, i64 1), align 4, !tbaa !7
  store i32 %157, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 4), align 16, !tbaa !7
  %158 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 5, i64 1), align 4, !tbaa !7
  store i32 %158, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 5), align 4, !tbaa !7
  %159 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 6, i64 1), align 4, !tbaa !7
  store i32 %159, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 6), align 8, !tbaa !7
  %160 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 7, i64 1), align 4, !tbaa !7
  store i32 %160, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 7), align 4, !tbaa !7
  %161 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 8, i64 1), align 4, !tbaa !7
  store i32 %161, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 8), align 16, !tbaa !7
  %162 = load i32, ptr getelementptr inbounds ([10 x [10 x i32]], ptr @_QFEc, i64 0, i64 9, i64 1), align 4, !tbaa !7
  store i32 %162, ptr getelementptr inbounds ([10 x i32], ptr @_QFEchanger, i64 0, i64 9), align 4, !tbaa !7
  %163 = load i32, ptr %3, align 4, !tbaa !7
  %164 = icmp sgt i32 %163, 0
  br i1 %164, label %.lr.ph232, label %._crit_edge233

.lr.ph232:                                        ; preds = %_QFPwarf.exit.preheader
  %165 = load i32, ptr %4, align 4, !tbaa !7
  %166 = icmp sgt i32 %165, 0
  %.unpack = load ptr, ptr @_QFEa.0, align 8
  %.unpack203.unpack.unpack206 = load i64, ptr @_QFEa.8, align 8
  br i1 %166, label %.lr.ph229.us.preheader, label %._crit_edge233

.lr.ph229.us.preheader:                           ; preds = %.lr.ph232
  %167 = zext i32 %165 to i64
  %168 = zext i32 %163 to i64
  %xtraiter = and i64 %167, 1
  %169 = icmp eq i32 %165, 1
  %unroll_iter = and i64 %167, 4294967294
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph229.us

.lr.ph229.us:                                     ; preds = %.lr.ph229.us.preheader, %._crit_edge.us
  %indvars.iv246 = phi i64 [ 1, %.lr.ph229.us.preheader ], [ %indvars.iv.next247, %._crit_edge.us ]
  %.0230.us = phi i32 [ 0, %.lr.ph229.us.preheader ], [ %.2.us.lcssa, %._crit_edge.us ]
  %170 = add nsw i64 %indvars.iv246, -1
  %171 = mul i64 %170, %.unpack203.unpack.unpack206
  br i1 %169, label %._crit_edge.us.unr-lcssa, label %.lr.ph229.us.new

.lr.ph229.us.new:                                 ; preds = %.lr.ph229.us, %190
  %indvars.iv242 = phi i64 [ %indvars.iv.next243.1, %190 ], [ 1, %.lr.ph229.us ]
  %.1228.us = phi i32 [ %.2.us.1, %190 ], [ %.0230.us, %.lr.ph229.us ]
  %niter = phi i64 [ %niter.next.1, %190 ], [ 0, %.lr.ph229.us ]
  %172 = add nsw i64 %indvars.iv242, -1
  %173 = add i64 %172, %171
  %174 = getelementptr i32, ptr %.unpack, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !7
  %.not.us = icmp eq i32 %175, -1
  br i1 %.not.us, label %181, label %176

176:                                              ; preds = %.lr.ph229.us.new
  %177 = sext i32 %175 to i64
  %178 = getelementptr [10 x i32], ptr @_QFEchanger, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !7
  %180 = add i32 %179, %.1228.us
  br label %181

181:                                              ; preds = %176, %.lr.ph229.us.new
  %.2.us = phi i32 [ %180, %176 ], [ %.1228.us, %.lr.ph229.us.new ]
  %182 = add i64 %indvars.iv242, %171
  %183 = getelementptr i32, ptr %.unpack, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !7
  %.not.us.1 = icmp eq i32 %184, -1
  br i1 %.not.us.1, label %190, label %185

185:                                              ; preds = %181
  %186 = sext i32 %184 to i64
  %187 = getelementptr [10 x i32], ptr @_QFEchanger, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !7
  %189 = add i32 %188, %.2.us
  br label %190

190:                                              ; preds = %185, %181
  %.2.us.1 = phi i32 [ %189, %185 ], [ %.2.us, %181 ]
  %indvars.iv.next243.1 = add nuw nsw i64 %indvars.iv242, 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.unr-lcssa, label %.lr.ph229.us.new

._crit_edge.us.unr-lcssa:                         ; preds = %190, %.lr.ph229.us
  %.2.us.lcssa.ph = phi i32 [ undef, %.lr.ph229.us ], [ %.2.us.1, %190 ]
  %indvars.iv242.unr = phi i64 [ 1, %.lr.ph229.us ], [ %indvars.iv.next243.1, %190 ]
  %.1228.us.unr = phi i32 [ %.0230.us, %.lr.ph229.us ], [ %.2.us.1, %190 ]
  br i1 %lcmp.mod.not, label %._crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us.unr-lcssa
  %191 = add nsw i64 %indvars.iv242.unr, -1
  %192 = add i64 %191, %171
  %193 = getelementptr i32, ptr %.unpack, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !7
  %.not.us.epil = icmp eq i32 %194, -1
  br i1 %.not.us.epil, label %._crit_edge.us, label %195

195:                                              ; preds = %.epil.preheader
  %196 = sext i32 %194 to i64
  %197 = getelementptr [10 x i32], ptr @_QFEchanger, i64 0, i64 %196
  %198 = load i32, ptr %197, align 4, !tbaa !7
  %199 = add i32 %198, %.1228.us.unr
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %.epil.preheader, %195, %._crit_edge.us.unr-lcssa
  %.2.us.lcssa = phi i32 [ %.2.us.lcssa.ph, %._crit_edge.us.unr-lcssa ], [ %199, %195 ], [ %.1228.us.unr, %.epil.preheader ]
  %indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1
  %exitcond249.not = icmp eq i64 %indvars.iv246, %168
  br i1 %exitcond249.not, label %._crit_edge233, label %.lr.ph229.us

._crit_edge233:                                   ; preds = %._crit_edge.us, %.lr.ph232, %_QFPwarf.exit.preheader
  %.0.lcssa = phi i32 [ 0, %_QFPwarf.exit.preheader ], [ 0, %.lr.ph232 ], [ %.2.us.lcssa, %._crit_edge.us ]
  %200 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ad0f666a320dc49d0c7f9c0eea6e457c, i32 30)
  %201 = call i1 @_FortranAioOutputInteger32(ptr %200, i32 %.0.lcssa)
  %202 = call i32 @_FortranAioEndIoStatement(ptr %200)
  ret void
}

; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QFPwarf(ptr nocapture readonly %0) local_unnamed_addr #1 {
  %2 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  %3 = load i64, ptr %2, align 8, !tbaa !3
  %sext = shl i64 %3, 32
  %4 = ashr exact i64 %sext, 32
  %5 = icmp sgt i64 %sext, 0
  br i1 %5, label %.preheader11.lr.ph, label %._crit_edge

.preheader11.lr.ph:                               ; preds = %1
  %6 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %7 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 1, i64 2
  %8 = load ptr, ptr %0, align 8, !tbaa !3
  %9 = load i64, ptr %6, align 8, !tbaa !3
  %10 = load i64, ptr %7, align 8, !tbaa !3
  br label %.preheader11.us.us

.preheader11.us.us:                               ; preds = %._crit_edge12.split.us.us.us, %.preheader11.lr.ph
  %indvars.iv20 = phi i64 [ %indvars.iv.next21, %._crit_edge12.split.us.us.us ], [ 1, %.preheader11.lr.ph ]
  %11 = phi i64 [ %37, %._crit_edge12.split.us.us.us ], [ %4, %.preheader11.lr.ph ]
  %12 = add nsw i64 %indvars.iv20, -1
  %13 = mul i64 %10, %12
  %14 = mul i64 %9, %12
  br label %.preheader.us.us.us

.preheader.us.us.us:                              ; preds = %._crit_edge.us.us.us, %.preheader11.us.us
  %indvars.iv17 = phi i64 [ %indvars.iv.next18, %._crit_edge.us.us.us ], [ 1, %.preheader11.us.us ]
  %15 = phi i64 [ %35, %._crit_edge.us.us.us ], [ %4, %.preheader11.us.us ]
  %16 = add nsw i64 %indvars.iv17, -1
  %17 = mul i64 %9, %16
  %18 = add i64 %13, %17
  %19 = getelementptr i8, ptr %8, i64 %18
  br label %20

20:                                               ; preds = %20, %.preheader.us.us.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 1, %.preheader.us.us.us ]
  %21 = phi i64 [ %33, %20 ], [ %4, %.preheader.us.us.us ]
  %22 = add nsw i64 %indvars.iv, -1
  %23 = mul i64 %10, %22
  %24 = add i64 %23, %17
  %25 = getelementptr i8, ptr %8, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %27 = load i32, ptr %19, align 4, !tbaa !7
  %28 = add i64 %23, %14
  %29 = getelementptr i8, ptr %8, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !7
  %31 = add i32 %30, %27
  %32 = tail call i32 @llvm.smin.i32(i32 %26, i32 %31)
  store i32 %32, ptr %25, align 4, !tbaa !7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = add nsw i64 %21, -1
  %34 = icmp sgt i64 %21, 1
  br i1 %34, label %20, label %._crit_edge.us.us.us

._crit_edge.us.us.us:                             ; preds = %20
  %indvars.iv.next18 = add nuw nsw i64 %indvars.iv17, 1
  %35 = add nsw i64 %15, -1
  %36 = icmp sgt i64 %15, 1
  br i1 %36, label %.preheader.us.us.us, label %._crit_edge12.split.us.us.us

._crit_edge12.split.us.us.us:                     ; preds = %._crit_edge.us.us.us
  %indvars.iv.next21 = add nuw nsw i64 %indvars.iv20, 1
  %37 = add nsw i64 %11, -1
  %38 = icmp sgt i64 %11, 1
  br i1 %38, label %.preheader11.us.us, label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge12.split.us.us.us, %1
  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 ptr @_FortranAioBeginExternalListOutput(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) #2

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable 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 = !{!"descriptor member", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any data access", !5, i64 0}
