program energy_drink_collector
  implicit none
  integer(8) :: n, m, ab(100000,2), i, p
  read(*,*) n, m
  ab = 0_8
  do i = 1, n
    read(*,*) ab(i,:)
  end do
  call merge_sort(n,ab(1:n,:),1_8)
  p = 0
  do i = 1, n
    if (m.le.ab(i,2)) then
      p = p + m*ab(i,1)
      exit
    else
      p = p + ab(i,2)*ab(i,1)
      m = m - ab(i,2)
    end if
  end do
  write(*,'(i0)') p
  stop
contains
  subroutine merge_sort(n,c,idx)
    implicit none
    integer(8), intent(in)    :: n, idx
    integer(8), intent(inout) :: c(n,2)
    integer(8)                :: number, length, i, ubound
    number = n
    length = 1
    do while (number .gt. 1)
      do i = 1, number/2
        ubound = min(2*i*length,n)
        call merge(c(2*(i-1)*length+1:(2*i-1)*length,:),c((2*i-1)*length+1:ubound,:),idx)
      end do
      length = 2*length
      number = (number+1)/2
    end do
    return
  end subroutine merge_sort
  subroutine merge(c1,c2,idx)
    implicit none
    integer(8), intent(inout) :: c1(:,:), c2(:,:)
    integer(8), intent(in)    :: idx
    integer(8)                :: c(size(c1(:,1))+size(c2(:,1)),size(c1(1,:)))
    integer(8)                :: i1, i2, n1, n2
    i1 = 1
    i2 = 1
    n1 = size(c1(:,1))
    n2 = size(c2(:,1))
    do while (i1 .le. n1 .and. i2 .le. n2)
      if (c1(i1,idx) .le. c2(i2,idx)) then
        c(i1+i2-1,:) = c1(i1,:)
        i1 = i1+1
      else
        c(i1+i2-1,:) = c2(i2,:)
        i2 = i2+1
      end if
    end do
    if (i1 .le. n1) then
      c(i1+i2-1:n1+n2,:) = c1(i1:n1,:)
    else if (i2 .le. n2) then
      c(i1+i2-1:n1+n2,:) = c2(i2:n2,:)
    end if
    c1 = c(1:n1,:)
    c2 = c(n1+1:n1+n2,:)
    return
  end subroutine merge
end program energy_drink_collector
; 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"

@_QFEab = internal global [2 x [100000 x i64]] undef
@_QQcl.9a6b6ccb9e9bad8a939e10a895a99417 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4763/source.f\00"
@_QQcl.28693029 = 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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #2 {
  %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, [2 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, align 8
  %5 = alloca i64, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9a6b6ccb9e9bad8a939e10a895a99417, i32 4)
  %10 = call i1 @_FortranAioInputInteger(ptr %9, ptr nonnull %8, i32 8)
  %11 = call i1 @_FortranAioInputInteger(ptr %9, ptr nonnull %7, i32 8)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %9)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1600000) @_QFEab, i8 0, i64 1600000, i1 false), !tbaa !3
  %13 = load i64, ptr %8, align 8, !tbaa !3
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.fca.1.gep171 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep173 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep175 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep177 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep179 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep181 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.fca.7.0.0.gep183 = 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.gep185 = 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.gep187 = 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 %15

15:                                               ; preds = %.lr.ph, %15
  %16 = phi i64 [ 1, %.lr.ph ], [ %22, %15 ]
  %17 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.9a6b6ccb9e9bad8a939e10a895a99417, i32 7)
  %18 = add nsw i64 %16, -1
  %19 = getelementptr [2 x [100000 x i64]], ptr @_QFEab, i64 0, i64 0, i64 %18
  store ptr %19, ptr %1, align 8, !tbaa !7
  store i64 8, ptr %.fca.1.gep171, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep173, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep175, align 4, !tbaa !7
  store i8 10, ptr %.fca.4.gep177, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep179, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep181, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep183, align 8, !tbaa !7
  store i64 2, ptr %.fca.7.0.1.gep185, align 8, !tbaa !7
  store i64 800000, ptr %.fca.7.0.2.gep187, align 8, !tbaa !7
  %20 = call i1 @_FortranAioInputDescriptor(ptr %17, ptr nonnull %1)
  %21 = call i32 @_FortranAioEndIoStatement(ptr %17)
  %22 = add nuw i64 %16, 1
  %exitcond.not = icmp eq i64 %16, %13
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %15

._crit_edge.loopexit:                             ; preds = %15
  %.pre = load i64, ptr %8, align 8, !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %23 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %13, %0 ]
  %24 = call i64 @llvm.smax.i64(i64 %23, i64 0)
  store ptr @_QFEab, ptr %3, align 8, !tbaa !7
  %.fca.1.gep41 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep41, align 8, !tbaa !7
  %.fca.2.gep43 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep43, align 8, !tbaa !7
  %.fca.3.gep45 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 3
  store i8 2, ptr %.fca.3.gep45, align 4, !tbaa !7
  %.fca.4.gep47 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep47, align 1, !tbaa !7
  %.fca.5.gep49 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep49, align 2, !tbaa !7
  %.fca.6.gep51 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep51, align 1, !tbaa !7
  %.fca.7.0.0.gep53 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep53, align 8, !tbaa !7
  %.fca.7.0.1.gep55 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  store i64 %24, ptr %.fca.7.0.1.gep55, align 8, !tbaa !7
  %.fca.7.0.2.gep57 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep57, align 8, !tbaa !7
  %.fca.7.1.0.gep59 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 1, i64 0
  store i64 1, ptr %.fca.7.1.0.gep59, align 8, !tbaa !7
  %.fca.7.1.1.gep61 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 1, i64 1
  store i64 2, ptr %.fca.7.1.1.gep61, align 8, !tbaa !7
  %.fca.7.1.2.gep63 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 1, i64 2
  store i64 800000, ptr %.fca.7.1.2.gep63, align 8, !tbaa !7
  %25 = call i1 @_FortranAIsContiguous(ptr nonnull %3)
  br i1 %25, label %26, label %28

26:                                               ; preds = %._crit_edge
  %27 = load ptr, ptr %3, align 8, !tbaa !7
  br label %35

28:                                               ; preds = %._crit_edge
  %29 = load i64, ptr %.fca.7.0.1.gep55, align 8, !tbaa !7
  %30 = load i64, ptr %.fca.7.1.1.gep61, align 8, !tbaa !7
  %31 = shl i64 %29, 3
  %32 = mul i64 %31, %30
  %33 = call ptr @malloc(i64 %32)
  store ptr %33, ptr %6, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 3
  store i8 2, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 1
  store i64 %29, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %.fca.7.1.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 1, i64 0
  store i64 1, ptr %.fca.7.1.0.gep, align 8, !tbaa !7
  %.fca.7.1.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 1, i64 1
  store i64 %30, ptr %.fca.7.1.1.gep, align 8, !tbaa !7
  %.fca.7.1.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %6, i64 0, i32 7, i64 1, i64 2
  store i64 %31, ptr %.fca.7.1.2.gep, align 8, !tbaa !7
  %34 = call {} @_FortranAAssign(ptr nonnull %6, ptr nonnull %3, ptr nonnull @_QQcl.9a6b6ccb9e9bad8a939e10a895a99417, i32 9)
  br label %35

35:                                               ; preds = %26, %28
  %36 = phi ptr [ %27, %26 ], [ %33, %28 ]
  %37 = load i64, ptr %.fca.7.0.1.gep55, align 8, !tbaa !7
  %38 = load i64, ptr %.fca.7.1.1.gep61, align 8, !tbaa !7
  store i64 1, ptr %5, align 8, !tbaa !3
  call void @_QFPmerge_sort(ptr nonnull %8, ptr %36, ptr nonnull %5)
  br i1 %25, label %42, label %39

39:                                               ; preds = %35
  %40 = shl i64 %37, 3
  store ptr %36, ptr %2, align 8, !tbaa !7
  %.fca.1.gep145 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep145, align 8, !tbaa !7
  %.fca.2.gep147 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep147, align 8, !tbaa !7
  %.fca.3.gep149 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 3
  store i8 2, ptr %.fca.3.gep149, align 4, !tbaa !7
  %.fca.4.gep151 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep151, align 1, !tbaa !7
  %.fca.5.gep153 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep153, align 2, !tbaa !7
  %.fca.6.gep155 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep155, align 1, !tbaa !7
  %.fca.7.0.0.gep157 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep157, align 8, !tbaa !7
  %.fca.7.0.1.gep159 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 1
  store i64 %37, ptr %.fca.7.0.1.gep159, align 8, !tbaa !7
  %.fca.7.0.2.gep161 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 0, i64 2
  store i64 8, ptr %.fca.7.0.2.gep161, align 8, !tbaa !7
  %.fca.7.1.0.gep163 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 1, i64 0
  store i64 1, ptr %.fca.7.1.0.gep163, align 8, !tbaa !7
  %.fca.7.1.1.gep165 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 1, i64 1
  store i64 %38, ptr %.fca.7.1.1.gep165, align 8, !tbaa !7
  %.fca.7.1.2.gep167 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %2, i64 0, i32 7, i64 1, i64 2
  store i64 %40, ptr %.fca.7.1.2.gep167, align 8, !tbaa !7
  %.fca.0.load = load ptr, ptr %3, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep41, align 8, !tbaa !7
  %.fca.2.load = load i32, ptr %.fca.2.gep43, align 8, !tbaa !7
  %.fca.3.load = load i8, ptr %.fca.3.gep45, align 4, !tbaa !7
  %.fca.4.load = load i8, ptr %.fca.4.gep47, align 1, !tbaa !7
  %.fca.5.load = load i8, ptr %.fca.5.gep49, align 2, !tbaa !7
  %.fca.6.load = load i8, ptr %.fca.6.gep51, align 1, !tbaa !7
  %.fca.7.0.0.load = load i64, ptr %.fca.7.0.0.gep53, align 8, !tbaa !7
  %.fca.7.0.1.load = load i64, ptr %.fca.7.0.1.gep55, align 8, !tbaa !7
  %.fca.7.0.2.load = load i64, ptr %.fca.7.0.2.gep57, align 8, !tbaa !7
  %.fca.7.1.0.load = load i64, ptr %.fca.7.1.0.gep59, align 8, !tbaa !7
  %.fca.7.1.1.load = load i64, ptr %.fca.7.1.1.gep61, align 8, !tbaa !7
  %.fca.7.1.2.load = load i64, ptr %.fca.7.1.2.gep63, align 8, !tbaa !7
  store ptr %.fca.0.load, ptr %4, align 8, !tbaa !7
  %.fca.1.gep13 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 1
  store i64 %.fca.1.load, ptr %.fca.1.gep13, align 8, !tbaa !7
  %.fca.2.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 2
  store i32 %.fca.2.load, ptr %.fca.2.gep15, align 8, !tbaa !7
  %.fca.3.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 3
  store i8 %.fca.3.load, ptr %.fca.3.gep17, align 4, !tbaa !7
  %.fca.4.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 4
  store i8 %.fca.4.load, ptr %.fca.4.gep19, align 1, !tbaa !7
  %.fca.5.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 5
  store i8 %.fca.5.load, ptr %.fca.5.gep21, align 2, !tbaa !7
  %.fca.6.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 6
  store i8 %.fca.6.load, ptr %.fca.6.gep23, align 1, !tbaa !7
  %.fca.7.0.0.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 0
  store i64 %.fca.7.0.0.load, ptr %.fca.7.0.0.gep25, align 8, !tbaa !7
  %.fca.7.0.1.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 1
  store i64 %.fca.7.0.1.load, ptr %.fca.7.0.1.gep27, align 8, !tbaa !7
  %.fca.7.0.2.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 2
  store i64 %.fca.7.0.2.load, ptr %.fca.7.0.2.gep29, align 8, !tbaa !7
  %.fca.7.1.0.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 0
  store i64 %.fca.7.1.0.load, ptr %.fca.7.1.0.gep31, align 8, !tbaa !7
  %.fca.7.1.1.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 1
  store i64 %.fca.7.1.1.load, ptr %.fca.7.1.1.gep33, align 8, !tbaa !7
  %.fca.7.1.2.gep35 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 2
  store i64 %.fca.7.1.2.load, ptr %.fca.7.1.2.gep35, align 8, !tbaa !7
  %41 = call {} @_FortranAAssign(ptr nonnull %4, ptr nonnull %2, ptr nonnull @_QQcl.9a6b6ccb9e9bad8a939e10a895a99417, i32 9)
  call void @free(ptr %36)
  br label %42

42:                                               ; preds = %39, %35
  %43 = load i64, ptr %8, align 8, !tbaa !3
  %44 = icmp sgt i64 %43, 0
  br i1 %44, label %.lr.ph201.preheader, label %.loopexit

.lr.ph201.preheader:                              ; preds = %42
  %.promoted = load i64, ptr %7, align 8, !tbaa !3
  br label %.lr.ph201

.lr.ph201:                                        ; preds = %.lr.ph201.preheader, %54
  %.0199 = phi i64 [ %56, %54 ], [ 0, %.lr.ph201.preheader ]
  %.0188198 = phi i64 [ %58, %54 ], [ 1, %.lr.ph201.preheader ]
  %45 = phi i64 [ %57, %54 ], [ %.promoted, %.lr.ph201.preheader ]
  %46 = add nsw i64 %.0188198, -1
  %47 = getelementptr [2 x [100000 x i64]], ptr @_QFEab, i64 0, i64 1, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !3
  %.not = icmp sgt i64 %45, %48
  %49 = getelementptr [2 x [100000 x i64]], ptr @_QFEab, i64 0, i64 0, i64 %46
  %50 = load i64, ptr %49, align 8, !tbaa !3
  br i1 %.not, label %54, label %51

51:                                               ; preds = %.lr.ph201
  %52 = mul i64 %50, %45
  %53 = add i64 %52, %.0199
  br label %.loopexit

54:                                               ; preds = %.lr.ph201
  %55 = mul i64 %50, %48
  %56 = add i64 %55, %.0199
  %57 = sub i64 %45, %48
  store i64 %57, ptr %7, align 8, !tbaa !3
  %58 = add nuw i64 %.0188198, 1
  %exitcond207.not = icmp eq i64 %.0188198, %43
  br i1 %exitcond207.not, label %.loopexit, label %.lr.ph201

.loopexit:                                        ; preds = %54, %42, %51
  %.1 = phi i64 [ %53, %51 ], [ 0, %42 ], [ %56, %54 ]
  %59 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.9a6b6ccb9e9bad8a939e10a895a99417, i32 20)
  %60 = call i1 @_FortranAioOutputInteger64(ptr %59, i64 %.1)
  %61 = call i32 @_FortranAioEndIoStatement(ptr %59)
  %62 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QFPmerge_sort(ptr nocapture readonly %0, ptr %1, ptr nocapture readonly %2) local_unnamed_addr #3 {
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, align 8
  %6 = load i64, ptr %0, align 8, !tbaa !3
  %7 = icmp sgt i64 %6, 1
  br i1 %7, label %.lr.ph41, label %._crit_edge42

.lr.ph41:                                         ; preds = %3
  %8 = shl i64 %6, 3
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 6
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 2
  %.fca.7.1.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 1, i64 0
  %.fca.7.1.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 1, i64 1
  %.fca.7.1.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 1, i64 2
  %.fca.1.gep13 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 1
  %.fca.2.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 2
  %.fca.3.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 3
  %.fca.4.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 4
  %.fca.5.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 5
  %.fca.6.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 6
  %.fca.7.0.0.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 0, i64 2
  %.fca.7.1.0.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 0
  %.fca.7.1.1.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 1
  %.fca.7.1.2.gep35 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %4, i64 0, i32 7, i64 1, i64 2
  br label %9

9:                                                ; preds = %.lr.ph41, %._crit_edge
  %.039 = phi i64 [ %6, %.lr.ph41 ], [ %32, %._crit_edge ]
  %.03638 = phi i64 [ 1, %.lr.ph41 ], [ %30, %._crit_edge ]
  %.not = icmp ult i64 %.039, 2
  br i1 %.not, label %._crit_edge42, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %10 = lshr i64 %.039, 1
  %11 = tail call i64 @llvm.smax.i64(i64 %.03638, i64 0)
  br label %12

12:                                               ; preds = %.lr.ph, %12
  %13 = phi i64 [ %10, %.lr.ph ], [ %28, %12 ]
  %14 = phi i64 [ 1, %.lr.ph ], [ %27, %12 ]
  %15 = shl i64 %14, 1
  %16 = mul i64 %15, %.03638
  %17 = load i64, ptr %0, align 8, !tbaa !3
  %18 = tail call i64 @llvm.smin.i64(i64 %16, i64 %17)
  %19 = add i64 %15, -2
  %20 = mul i64 %19, %.03638
  %21 = add i64 %15, -1
  %22 = mul i64 %21, %.03638
  %23 = getelementptr i64, ptr %1, i64 %20
  store ptr %23, ptr %5, align 8, !tbaa !7
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 2, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 10, 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 %11, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  store i64 1, ptr %.fca.7.1.0.gep, align 8, !tbaa !7
  store i64 2, ptr %.fca.7.1.1.gep, align 8, !tbaa !7
  store i64 %8, ptr %.fca.7.1.2.gep, align 8, !tbaa !7
  %24 = sub i64 %18, %22
  %25 = tail call i64 @llvm.smax.i64(i64 %24, i64 0)
  %26 = getelementptr i64, ptr %1, i64 %22
  store ptr %26, ptr %4, align 8, !tbaa !7
  store i64 8, ptr %.fca.1.gep13, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep15, align 8, !tbaa !7
  store i8 2, ptr %.fca.3.gep17, align 4, !tbaa !7
  store i8 10, ptr %.fca.4.gep19, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep21, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep23, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep25, align 8, !tbaa !7
  store i64 %25, ptr %.fca.7.0.1.gep27, align 8, !tbaa !7
  store i64 8, ptr %.fca.7.0.2.gep29, align 8, !tbaa !7
  store i64 1, ptr %.fca.7.1.0.gep31, align 8, !tbaa !7
  store i64 2, ptr %.fca.7.1.1.gep33, align 8, !tbaa !7
  store i64 %8, ptr %.fca.7.1.2.gep35, align 8, !tbaa !7
  call void @_QFPmerge(ptr nonnull %5, ptr nonnull %4, ptr %2)
  %27 = add nuw i64 %14, 1
  %28 = add nsw i64 %13, -1
  %29 = icmp ugt i64 %13, 1
  br i1 %29, label %12, label %._crit_edge

._crit_edge:                                      ; preds = %12
  %30 = shl i64 %.03638, 1
  %31 = add i64 %.039, 1
  %32 = lshr i64 %31, 1
  %33 = icmp sgt i64 %31, 3
  br i1 %33, label %9, label %._crit_edge42

._crit_edge42:                                    ; preds = %9, %._crit_edge, %3
  ret void
}

; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QFPmerge(ptr nocapture readonly %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr #3 {
  %4 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  %5 = load i64, ptr %4, align 8, !tbaa !7
  %6 = tail call i64 @llvm.smax.i64(i64 %5, i64 0)
  %7 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  %8 = load i64, ptr %7, align 8, !tbaa !7
  %9 = tail call i64 @llvm.smax.i64(i64 %8, i64 0)
  %10 = add nuw i64 %9, %6
  %sext = shl i64 %10, 32
  %11 = ashr exact i64 %sext, 32
  %12 = tail call i64 @llvm.smax.i64(i64 %11, i64 0)
  %13 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 1, i64 1
  %14 = load i64, ptr %13, align 8, !tbaa !7
  %15 = tail call i64 @llvm.smax.i64(i64 %14, i64 0)
  %16 = and i64 %15, 4294967295
  %17 = trunc i64 %15 to i32
  %18 = icmp sgt i32 %17, 0
  %19 = select i1 %18, i64 %16, i64 0
  %.fr137 = freeze i64 %19
  %20 = mul nuw nsw i64 %12, %.fr137
  %21 = alloca i64, i64 %20, align 8
  %sext37 = shl i64 %6, 32
  %22 = ashr exact i64 %sext37, 32
  %sext38 = shl i64 %9, 32
  %23 = ashr exact i64 %sext38, 32
  %24 = icmp sgt i64 %sext38, 0
  %25 = icmp sgt i64 %sext37, 0
  %26 = and i1 %24, %25
  br i1 %26, label %.lr.ph54.lr.ph, label %.outer._crit_edge

.lr.ph54.lr.ph:                                   ; preds = %3
  %27 = load i64, ptr %2, align 8, !tbaa !3
  %28 = add i64 %27, -1
  %29 = load ptr, ptr %0, align 8, !tbaa !7
  %30 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %31 = load i64, ptr %30, align 8, !tbaa !7
  %32 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 1, i64 2
  %33 = load i64, ptr %32, align 8, !tbaa !7
  %34 = mul i64 %33, %28
  %35 = load ptr, ptr %1, align 8, !tbaa !7
  %36 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %37 = load i64, ptr %36, align 8, !tbaa !7
  %38 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 1, i64 2
  %39 = load i64, ptr %38, align 8, !tbaa !7
  %40 = mul i64 %39, %28
  %.not138 = icmp eq i64 %.fr137, 0
  %41 = icmp sgt i64 %.fr137, 0
  %42 = add nsw i64 %22, 1
  %xtraiter = and i64 %.fr137, 1
  %43 = icmp eq i64 %.fr137, 1
  %unroll_iter = and i64 %.fr137, -2
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph54.lr.ph, %.outer
  %.0.ph118 = phi i64 [ 1, %.lr.ph54.lr.ph ], [ %.us-phi65, %.outer ]
  %.027.ph116 = phi i64 [ 1, %.lr.ph54.lr.ph ], [ %103, %.outer ]
  %44 = add nsw i64 %.027.ph116, -1
  %45 = mul i64 %37, %44
  %46 = add i64 %40, %45
  %47 = getelementptr i8, ptr %35, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !3
  br i1 %.not138, label %.lr.ph54.split.split, label %.lr.ph54.split.us.split

.lr.ph54.split.us.split:                          ; preds = %.lr.ph54, %._crit_edge.us
  %.053.us = phi i64 [ %69, %._crit_edge.us ], [ %.0.ph118, %.lr.ph54 ]
  %49 = add i64 %.053.us, -1
  %50 = mul i64 %31, %49
  %51 = add i64 %34, %50
  %52 = getelementptr i8, ptr %29, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !3
  %.not.us = icmp sgt i64 %53, %48
  br i1 %.not.us, label %.split.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph54.split.us.split
  %54 = add i64 %.053.us, %.027.ph116
  %55 = add i64 %54, -2
  br label %56

56:                                               ; preds = %.lr.ph.us, %56
  %57 = phi i64 [ %.fr137, %.lr.ph.us ], [ %67, %56 ]
  %58 = phi i64 [ 0, %.lr.ph.us ], [ %59, %56 ]
  %59 = add nuw nsw i64 %58, 1
  %60 = mul i64 %58, %33
  %61 = add i64 %60, %50
  %62 = getelementptr i8, ptr %29, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !3
  %64 = mul i64 %58, %12
  %65 = add i64 %55, %64
  %66 = getelementptr i64, ptr %21, i64 %65
  store i64 %63, ptr %66, align 8, !tbaa !3
  %67 = add nsw i64 %57, -1
  %68 = icmp sgt i64 %57, 1
  br i1 %68, label %56, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %56
  %69 = add i64 %.053.us, 1
  %.not171 = icmp sgt i64 %69, %22
  br i1 %.not171, label %.thread, label %.lr.ph54.split.us.split

.lr.ph54.split.split:                             ; preds = %.lr.ph54, %75
  %.053 = phi i64 [ %76, %75 ], [ %.0.ph118, %.lr.ph54 ]
  %70 = add i64 %.053, -1
  %71 = mul i64 %31, %70
  %72 = add i64 %34, %71
  %73 = getelementptr i8, ptr %29, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !3
  %.not = icmp sgt i64 %74, %48
  br i1 %.not, label %.split.us, label %75

75:                                               ; preds = %.lr.ph54.split.split
  %76 = add i64 %.053, 1
  %.not172 = icmp sgt i64 %76, %22
  br i1 %.not172, label %.thread.loopexit, label %.lr.ph54.split.split

.split.us:                                        ; preds = %.lr.ph54.split.us.split, %.lr.ph54.split.split
  %.us-phi65 = phi i64 [ %.053, %.lr.ph54.split.split ], [ %.053.us, %.lr.ph54.split.us.split ]
  br i1 %41, label %.lr.ph, label %.outer

.lr.ph:                                           ; preds = %.split.us
  %77 = add i64 %.us-phi65, %.027.ph116
  %78 = add i64 %77, -2
  br i1 %43, label %.outer.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph, %.lr.ph.new
  %79 = phi i64 [ %88, %.lr.ph.new ], [ 0, %.lr.ph ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph.new ], [ 0, %.lr.ph ]
  %80 = or i64 %79, 1
  %81 = mul i64 %79, %39
  %82 = add i64 %81, %45
  %83 = getelementptr i8, ptr %35, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !3
  %85 = mul i64 %79, %12
  %86 = add i64 %78, %85
  %87 = getelementptr i64, ptr %21, i64 %86
  store i64 %84, ptr %87, align 8, !tbaa !3
  %88 = add nuw nsw i64 %79, 2
  %89 = mul i64 %80, %39
  %90 = add i64 %89, %45
  %91 = getelementptr i8, ptr %35, i64 %90
  %92 = load i64, ptr %91, align 8, !tbaa !3
  %93 = mul i64 %80, %12
  %94 = add i64 %78, %93
  %95 = getelementptr i64, ptr %21, i64 %94
  store i64 %92, ptr %95, align 8, !tbaa !3
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.outer.loopexit.unr-lcssa, label %.lr.ph.new

.outer.loopexit.unr-lcssa:                        ; preds = %.lr.ph.new, %.lr.ph
  %.unr = phi i64 [ 0, %.lr.ph ], [ %88, %.lr.ph.new ]
  br i1 %lcmp.mod.not, label %.outer, label %.outer.loopexit.epilog-lcssa

.outer.loopexit.epilog-lcssa:                     ; preds = %.outer.loopexit.unr-lcssa
  %96 = mul i64 %.unr, %39
  %97 = add i64 %96, %45
  %98 = getelementptr i8, ptr %35, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !3
  %100 = mul i64 %.unr, %12
  %101 = add i64 %78, %100
  %102 = getelementptr i64, ptr %21, i64 %101
  store i64 %99, ptr %102, align 8, !tbaa !3
  br label %.outer

.outer:                                           ; preds = %.outer.loopexit.epilog-lcssa, %.outer.loopexit.unr-lcssa, %.split.us
  %103 = add nuw nsw i64 %.027.ph116, 1
  %104 = icmp slt i64 %.027.ph116, %23
  %105 = icmp sle i64 %.us-phi65, %22
  %106 = and i1 %104, %105
  br i1 %106, label %.lr.ph54, label %.outer._crit_edge

.outer._crit_edge:                                ; preds = %.outer, %3
  %.027.ph.lcssa = phi i64 [ 1, %3 ], [ %103, %.outer ]
  %.0.lcssa = phi i64 [ 1, %3 ], [ %.us-phi65, %.outer ]
  %.lcssa47 = phi i1 [ %25, %3 ], [ %105, %.outer ]
  %.lcssa = phi i1 [ %24, %3 ], [ %104, %.outer ]
  br i1 %.lcssa47, label %107, label %153

107:                                              ; preds = %.outer._crit_edge
  %108 = add i64 %.0.lcssa, %.027.ph.lcssa
  %109 = add nsw i64 %23, %22
  %110 = add nsw i64 %109, 2
  %111 = sub i64 %110, %108
  %112 = tail call i64 @llvm.smax.i64(i64 %111, i64 0)
  %.not135 = icmp eq i64 %.fr137, 0
  br i1 %.not135, label %.loopexit, label %.preheader43.lr.ph

.preheader43.lr.ph:                               ; preds = %107
  %.not136 = icmp slt i64 %111, 1
  %113 = add i64 %.0.lcssa, -1
  %114 = add i64 %108, -2
  br i1 %.not136, label %.loopexit, label %.preheader43.lr.ph.split.us

.preheader43.lr.ph.split.us:                      ; preds = %.preheader43.lr.ph
  %115 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 1, i64 2
  %116 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %117 = load i64, ptr %116, align 8, !tbaa !7
  %118 = load i64, ptr %115, align 8, !tbaa !7
  %119 = load ptr, ptr %0, align 8, !tbaa !7
  %xtraiter232 = and i64 %112, 1
  %120 = icmp eq i64 %112, 1
  %unroll_iter235 = and i64 %112, 9223372036854775806
  %lcmp.mod234.not = icmp eq i64 %xtraiter232, 0
  br label %.preheader43.us

.preheader43.us:                                  ; preds = %._crit_edge126.us, %.preheader43.lr.ph.split.us
  %121 = phi i64 [ %.fr137, %.preheader43.lr.ph.split.us ], [ %151, %._crit_edge126.us ]
  %122 = phi i64 [ 0, %.preheader43.lr.ph.split.us ], [ %150, %._crit_edge126.us ]
  %123 = mul i64 %118, %122
  %124 = mul i64 %122, %12
  %125 = add i64 %114, %124
  br i1 %120, label %._crit_edge126.us.unr-lcssa, label %.preheader43.us.new

.preheader43.us.new:                              ; preds = %.preheader43.us, %.preheader43.us.new
  %126 = phi i64 [ %135, %.preheader43.us.new ], [ 0, %.preheader43.us ]
  %niter236 = phi i64 [ %niter236.next.1, %.preheader43.us.new ], [ 0, %.preheader43.us ]
  %127 = or i64 %126, 1
  %128 = add i64 %113, %126
  %129 = mul i64 %117, %128
  %130 = add i64 %123, %129
  %131 = getelementptr i8, ptr %119, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !3
  %133 = add i64 %125, %126
  %134 = getelementptr i64, ptr %21, i64 %133
  store i64 %132, ptr %134, align 8, !tbaa !3
  %135 = add nuw nsw i64 %126, 2
  %136 = add i64 %113, %127
  %137 = mul i64 %117, %136
  %138 = add i64 %123, %137
  %139 = getelementptr i8, ptr %119, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !3
  %141 = add i64 %125, %127
  %142 = getelementptr i64, ptr %21, i64 %141
  store i64 %140, ptr %142, align 8, !tbaa !3
  %niter236.next.1 = add i64 %niter236, 2
  %niter236.ncmp.1 = icmp eq i64 %niter236.next.1, %unroll_iter235
  br i1 %niter236.ncmp.1, label %._crit_edge126.us.unr-lcssa, label %.preheader43.us.new

._crit_edge126.us.unr-lcssa:                      ; preds = %.preheader43.us.new, %.preheader43.us
  %.unr233 = phi i64 [ 0, %.preheader43.us ], [ %135, %.preheader43.us.new ]
  br i1 %lcmp.mod234.not, label %._crit_edge126.us, label %._crit_edge126.us.epilog-lcssa

._crit_edge126.us.epilog-lcssa:                   ; preds = %._crit_edge126.us.unr-lcssa
  %143 = add i64 %113, %.unr233
  %144 = mul i64 %117, %143
  %145 = add i64 %123, %144
  %146 = getelementptr i8, ptr %119, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !3
  %148 = add i64 %125, %.unr233
  %149 = getelementptr i64, ptr %21, i64 %148
  store i64 %147, ptr %149, align 8, !tbaa !3
  br label %._crit_edge126.us

._crit_edge126.us:                                ; preds = %._crit_edge126.us.unr-lcssa, %._crit_edge126.us.epilog-lcssa
  %150 = add nuw i64 %122, 1
  %151 = add i64 %121, -1
  %152 = icmp sgt i64 %151, 0
  br i1 %152, label %.preheader43.us, label %.loopexit

153:                                              ; preds = %.outer._crit_edge
  br i1 %.lcssa, label %.thread, label %.loopexit

.thread.loopexit:                                 ; preds = %75
  %154 = add i64 %.0.ph118, 1
  %smax.le = tail call i64 @llvm.smax.i64(i64 %154, i64 %42)
  br label %.thread

.thread:                                          ; preds = %._crit_edge.us, %.thread.loopexit, %153
  %.027.ph.lcssa177184 = phi i64 [ %.027.ph.lcssa, %153 ], [ %.027.ph116, %.thread.loopexit ], [ %.027.ph116, %._crit_edge.us ]
  %.0.lcssa178183 = phi i64 [ %.0.lcssa, %153 ], [ %smax.le, %.thread.loopexit ], [ %69, %._crit_edge.us ]
  %155 = add i64 %.0.lcssa178183, %.027.ph.lcssa177184
  %156 = add nsw i64 %23, %22
  %157 = add nsw i64 %156, 2
  %158 = sub i64 %157, %155
  %159 = tail call i64 @llvm.smax.i64(i64 %158, i64 0)
  %.not133 = icmp eq i64 %.fr137, 0
  br i1 %.not133, label %.loopexit, label %.preheader44.lr.ph

.preheader44.lr.ph:                               ; preds = %.thread
  %.not134 = icmp slt i64 %158, 1
  %160 = add i64 %.027.ph.lcssa177184, -1
  %161 = add i64 %155, -2
  br i1 %.not134, label %.loopexit, label %.preheader44.lr.ph.split.us

.preheader44.lr.ph.split.us:                      ; preds = %.preheader44.lr.ph
  %162 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 1, i64 2
  %163 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %164 = load i64, ptr %163, align 8, !tbaa !7
  %165 = load i64, ptr %162, align 8, !tbaa !7
  %166 = load ptr, ptr %1, align 8, !tbaa !7
  %xtraiter226 = and i64 %159, 1
  %167 = icmp eq i64 %159, 1
  %unroll_iter229 = and i64 %159, 9223372036854775806
  %lcmp.mod228.not = icmp eq i64 %xtraiter226, 0
  br label %.preheader44.us

.preheader44.us:                                  ; preds = %._crit_edge124.us, %.preheader44.lr.ph.split.us
  %168 = phi i64 [ %.fr137, %.preheader44.lr.ph.split.us ], [ %198, %._crit_edge124.us ]
  %169 = phi i64 [ 0, %.preheader44.lr.ph.split.us ], [ %197, %._crit_edge124.us ]
  %170 = mul i64 %165, %169
  %171 = mul i64 %169, %12
  %172 = add i64 %161, %171
  br i1 %167, label %._crit_edge124.us.unr-lcssa, label %.preheader44.us.new

.preheader44.us.new:                              ; preds = %.preheader44.us, %.preheader44.us.new
  %173 = phi i64 [ %182, %.preheader44.us.new ], [ 0, %.preheader44.us ]
  %niter230 = phi i64 [ %niter230.next.1, %.preheader44.us.new ], [ 0, %.preheader44.us ]
  %174 = or i64 %173, 1
  %175 = add nuw i64 %160, %173
  %176 = mul i64 %164, %175
  %177 = add i64 %170, %176
  %178 = getelementptr i8, ptr %166, i64 %177
  %179 = load i64, ptr %178, align 8, !tbaa !3
  %180 = add i64 %172, %173
  %181 = getelementptr i64, ptr %21, i64 %180
  store i64 %179, ptr %181, align 8, !tbaa !3
  %182 = add nuw nsw i64 %173, 2
  %183 = add nuw i64 %160, %174
  %184 = mul i64 %164, %183
  %185 = add i64 %170, %184
  %186 = getelementptr i8, ptr %166, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !3
  %188 = add i64 %172, %174
  %189 = getelementptr i64, ptr %21, i64 %188
  store i64 %187, ptr %189, align 8, !tbaa !3
  %niter230.next.1 = add i64 %niter230, 2
  %niter230.ncmp.1 = icmp eq i64 %niter230.next.1, %unroll_iter229
  br i1 %niter230.ncmp.1, label %._crit_edge124.us.unr-lcssa, label %.preheader44.us.new

._crit_edge124.us.unr-lcssa:                      ; preds = %.preheader44.us.new, %.preheader44.us
  %.unr227 = phi i64 [ 0, %.preheader44.us ], [ %182, %.preheader44.us.new ]
  br i1 %lcmp.mod228.not, label %._crit_edge124.us, label %._crit_edge124.us.epilog-lcssa

._crit_edge124.us.epilog-lcssa:                   ; preds = %._crit_edge124.us.unr-lcssa
  %190 = add nuw i64 %160, %.unr227
  %191 = mul i64 %164, %190
  %192 = add i64 %170, %191
  %193 = getelementptr i8, ptr %166, i64 %192
  %194 = load i64, ptr %193, align 8, !tbaa !3
  %195 = add i64 %172, %.unr227
  %196 = getelementptr i64, ptr %21, i64 %195
  store i64 %194, ptr %196, align 8, !tbaa !3
  br label %._crit_edge124.us

._crit_edge124.us:                                ; preds = %._crit_edge124.us.unr-lcssa, %._crit_edge124.us.epilog-lcssa
  %197 = add nuw i64 %169, 1
  %198 = add i64 %168, -1
  %199 = icmp sgt i64 %198, 0
  br i1 %199, label %.preheader44.us, label %.loopexit

.loopexit:                                        ; preds = %._crit_edge124.us, %._crit_edge126.us, %.preheader44.lr.ph, %.preheader43.lr.ph, %.thread, %107, %153
  %200 = icmp sgt i64 %14, 0
  %201 = icmp sgt i64 %5, 0
  %or.cond = select i1 %200, i1 %201, i1 false
  br i1 %or.cond, label %.preheader42.lr.ph.split.us, label %._crit_edge129

.preheader42.lr.ph.split.us:                      ; preds = %.loopexit
  %202 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 1, i64 2
  %203 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %204 = load i64, ptr %203, align 8, !tbaa !7
  %205 = load i64, ptr %202, align 8, !tbaa !7
  %206 = load ptr, ptr %0, align 8, !tbaa !7
  %xtraiter238 = and i64 %5, 1
  %207 = icmp eq i64 %5, 1
  %unroll_iter241 = and i64 %5, -2
  %lcmp.mod240.not = icmp eq i64 %xtraiter238, 0
  br label %.preheader42.us

.preheader42.us:                                  ; preds = %._crit_edge128.us, %.preheader42.lr.ph.split.us
  %208 = phi i64 [ 0, %.preheader42.lr.ph.split.us ], [ %232, %._crit_edge128.us ]
  %209 = mul i64 %208, %12
  %210 = mul i64 %205, %208
  br i1 %207, label %._crit_edge128.us.unr-lcssa, label %.preheader42.us.new

.preheader42.us.new:                              ; preds = %.preheader42.us, %.preheader42.us.new
  %211 = phi i64 [ %219, %.preheader42.us.new ], [ 0, %.preheader42.us ]
  %niter242 = phi i64 [ %niter242.next.1, %.preheader42.us.new ], [ 0, %.preheader42.us ]
  %212 = or i64 %211, 1
  %213 = add i64 %211, %209
  %214 = getelementptr i64, ptr %21, i64 %213
  %215 = load i64, ptr %214, align 8, !tbaa !3
  %216 = mul i64 %204, %211
  %217 = add i64 %210, %216
  %218 = getelementptr i8, ptr %206, i64 %217
  store i64 %215, ptr %218, align 8, !tbaa !3
  %219 = add nuw nsw i64 %211, 2
  %220 = add i64 %212, %209
  %221 = getelementptr i64, ptr %21, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !3
  %223 = mul i64 %204, %212
  %224 = add i64 %210, %223
  %225 = getelementptr i8, ptr %206, i64 %224
  store i64 %222, ptr %225, align 8, !tbaa !3
  %niter242.next.1 = add i64 %niter242, 2
  %niter242.ncmp.1 = icmp eq i64 %niter242.next.1, %unroll_iter241
  br i1 %niter242.ncmp.1, label %._crit_edge128.us.unr-lcssa, label %.preheader42.us.new

._crit_edge128.us.unr-lcssa:                      ; preds = %.preheader42.us.new, %.preheader42.us
  %.unr239 = phi i64 [ 0, %.preheader42.us ], [ %219, %.preheader42.us.new ]
  br i1 %lcmp.mod240.not, label %._crit_edge128.us, label %._crit_edge128.us.epilog-lcssa

._crit_edge128.us.epilog-lcssa:                   ; preds = %._crit_edge128.us.unr-lcssa
  %226 = add i64 %.unr239, %209
  %227 = getelementptr i64, ptr %21, i64 %226
  %228 = load i64, ptr %227, align 8, !tbaa !3
  %229 = mul i64 %204, %.unr239
  %230 = add i64 %210, %229
  %231 = getelementptr i8, ptr %206, i64 %230
  store i64 %228, ptr %231, align 8, !tbaa !3
  br label %._crit_edge128.us

._crit_edge128.us:                                ; preds = %._crit_edge128.us.unr-lcssa, %._crit_edge128.us.epilog-lcssa
  %232 = add nuw i64 %208, 1
  %exitcond168.not = icmp eq i64 %232, %14
  br i1 %exitcond168.not, label %._crit_edge129, label %.preheader42.us

._crit_edge129:                                   ; preds = %._crit_edge128.us, %.loopexit
  %233 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 1, i64 1
  %234 = load i64, ptr %233, align 8, !tbaa !7
  %235 = icmp sgt i64 %234, 0
  %236 = icmp sgt i64 %8, 0
  %or.cond198 = select i1 %235, i1 %236, i1 false
  br i1 %or.cond198, label %.preheader.lr.ph.split.us, label %._crit_edge132

.preheader.lr.ph.split.us:                        ; preds = %._crit_edge129
  %237 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 1, i64 2
  %238 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [2 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  %239 = load i64, ptr %238, align 8, !tbaa !7
  %240 = load i64, ptr %237, align 8, !tbaa !7
  %241 = load ptr, ptr %1, align 8, !tbaa !7
  %xtraiter244 = and i64 %8, 1
  %242 = icmp eq i64 %8, 1
  %unroll_iter247 = and i64 %8, -2
  %lcmp.mod246.not = icmp eq i64 %xtraiter244, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %._crit_edge131.us, %.preheader.lr.ph.split.us
  %243 = phi i64 [ 0, %.preheader.lr.ph.split.us ], [ %268, %._crit_edge131.us ]
  %244 = mul i64 %243, %12
  %245 = add i64 %244, %22
  %246 = mul i64 %240, %243
  br i1 %242, label %._crit_edge131.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %247 = phi i64 [ %255, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter248 = phi i64 [ %niter248.next.1, %.preheader.us.new ], [ 0, %.preheader.us ]
  %248 = or i64 %247, 1
  %249 = add i64 %245, %247
  %250 = getelementptr i64, ptr %21, i64 %249
  %251 = load i64, ptr %250, align 8, !tbaa !3
  %252 = mul i64 %239, %247
  %253 = add i64 %246, %252
  %254 = getelementptr i8, ptr %241, i64 %253
  store i64 %251, ptr %254, align 8, !tbaa !3
  %255 = add nuw nsw i64 %247, 2
  %256 = add i64 %245, %248
  %257 = getelementptr i64, ptr %21, i64 %256
  %258 = load i64, ptr %257, align 8, !tbaa !3
  %259 = mul i64 %239, %248
  %260 = add i64 %246, %259
  %261 = getelementptr i8, ptr %241, i64 %260
  store i64 %258, ptr %261, align 8, !tbaa !3
  %niter248.next.1 = add i64 %niter248, 2
  %niter248.ncmp.1 = icmp eq i64 %niter248.next.1, %unroll_iter247
  br i1 %niter248.ncmp.1, label %._crit_edge131.us.unr-lcssa, label %.preheader.us.new

._crit_edge131.us.unr-lcssa:                      ; preds = %.preheader.us.new, %.preheader.us
  %.unr245 = phi i64 [ 0, %.preheader.us ], [ %255, %.preheader.us.new ]
  br i1 %lcmp.mod246.not, label %._crit_edge131.us, label %._crit_edge131.us.epilog-lcssa

._crit_edge131.us.epilog-lcssa:                   ; preds = %._crit_edge131.us.unr-lcssa
  %262 = add i64 %245, %.unr245
  %263 = getelementptr i64, ptr %21, i64 %262
  %264 = load i64, ptr %263, align 8, !tbaa !3
  %265 = mul i64 %239, %.unr245
  %266 = add i64 %246, %265
  %267 = getelementptr i8, ptr %241, i64 %266
  store i64 %264, ptr %267, align 8, !tbaa !3
  br label %._crit_edge131.us

._crit_edge131.us:                                ; preds = %._crit_edge131.us.unr-lcssa, %._crit_edge131.us.epilog-lcssa
  %268 = add nuw i64 %243, 1
  %exitcond170.not = icmp eq i64 %268, %234
  br i1 %exitcond170.not, label %._crit_edge132, label %.preheader.us

._crit_edge132:                                   ; preds = %._crit_edge131.us, %._crit_edge129
  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 i1 @_FortranAIsContiguous(ptr) local_unnamed_addr

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

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

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

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

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

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

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