program match_matching
  implicit none
  integer              :: n, m, b(9), i, j, d, r
  integer, allocatable :: a(:), dp(:)
  character(16384)     :: answer
  read(*,*) n, m
  allocate(a(m),dp(0:n))
  read(*,*) a(:)
  b = (/2,5,5,4,5,6,3,7,6/)
  call reverse_sort(m,a)
  dp = -1
  dp(0) = 0
  do i = 2, n
    d = -1
    do j = 1, m
      if (i-b(a(j)) .ge. 0) then
        if (dp(i-b(a(j))) .gt. d) d = dp(i-b(a(j)))
      end if
      if (d .lt. 0) then
        dp(i) = -1
      else
        dp(i) = d + 1
      end if
    end do
  end do
  r = n
  i = 1
  answer = ''
  do while (r .gt. 0)
    do j = 1, m
      if (r-b(a(j)) .ge. 0) then
        if (dp(r-b(a(j))) .eq. dp(r)-1) then
          answer(i:i) = achar(48+a(j))
          r = r - b(a(j))
          i = i + 1
          exit
        end if
      end if
    end do
  end do
  deallocate(a,dp)
  write(*,'(a)') answer(1:i)
  stop

contains

  subroutine reverse_sort(m,a)
    implicit none
    integer, intent(in)    :: m
    integer, intent(inout) :: a(m)
    integer                :: i, j
    do i = m-1, 1, -1
      do j = 1, i
        if (a(j) .lt. a(j+1)) call swap(a(j),a(j+1))
      end do
    end do
    return
  end subroutine reverse_sort

  subroutine swap(a,b)
    implicit none
    integer, intent(inout) :: a, b
    integer                :: c
    c = a
    a = b
    b = c
    return
  end subroutine swap

end program match_matching
; 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
@_QFEanswer = internal global [16384 x i8] undef
@_QFEb = internal unnamed_addr global [9 x i32] undef
@_QFEdp.0 = internal unnamed_addr global ptr null
@_QFEdp.7 = internal unnamed_addr global i64 1
@_QFEdp.8 = internal unnamed_addr global i64 0
@_QQcl.e3e03d00bb84f44cd49fcd54d9faa92e = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4951/source.f\00"
@_QQro.9xi4.572e6122953e4a20cc7b000002741307 = internal unnamed_addr constant [9 x i32] [i32 2, i32 5, i32 5, i32 4, i32 5, i32 6, i32 3, i32 7, i32 6]
@_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.286129 = linkonce constant [3 x i8] c"(a)"
@_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e3e03d00bb84f44cd49fcd54d9faa92e, i32 6)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %8 = load i32, ptr %2, align 4, !tbaa !3
  %9 = call i32 @llvm.smax.i32(i32 %8, i32 0)
  %10 = zext i32 %9 to i64
  %11 = shl nuw nsw i64 %10, 2
  %12 = call ptr @malloc(i64 %11)
  store ptr %12, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEa.8, align 8, !tbaa !7
  %13 = load i32, ptr %3, align 4, !tbaa !3
  %14 = call i32 @llvm.smax.i32(i32 %13, i32 -1)
  %15 = sext i32 %14 to i64
  %16 = add nsw i64 %15, 1
  %17 = shl nuw nsw i64 %16, 2
  %18 = call ptr @malloc(i64 %17)
  %19 = icmp eq i64 %16, 0
  %20 = zext i1 %19 to i64
  store ptr %18, ptr @_QFEdp.0, align 8, !tbaa !7
  store i64 %20, ptr @_QFEdp.7, align 8, !tbaa !7
  store i64 %16, ptr @_QFEdp.8, align 8, !tbaa !7
  %21 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e3e03d00bb84f44cd49fcd54d9faa92e, i32 8)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack808.unpack.unpack810 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %22 = call i64 @llvm.smax.i64(i64 %.unpack808.unpack.unpack810, i64 0)
  store ptr %.unpack, ptr %1, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, 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, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, 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, [1 x [3 x i64]] }, ptr %1, 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, [1 x [3 x i64]] }, ptr %1, 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, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 1
  store i64 %22, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %23 = call i1 @_FortranAioInputDescriptor(ptr %21, ptr nonnull %1)
  %24 = call i32 @_FortranAioEndIoStatement(ptr %21)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @_QFEb, ptr noundef nonnull align 16 dereferenceable(36) @_QQro.9xi4.572e6122953e4a20cc7b000002741307, i64 36, i1 false), !tbaa !3
  %.unpack813 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %25 = load i32, ptr %2, align 4, !tbaa !3
  %26 = add i32 %25, -1
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph7.preheader.i, label %_QFPreverse_sort.exit

.lr.ph7.preheader.i:                              ; preds = %0
  %28 = zext i32 %26 to i64
  br label %.lr.ph7.i

.lr.ph7.i:                                        ; preds = %._crit_edge.i, %.lr.ph7.preheader.i
  %29 = phi i64 [ %45, %._crit_edge.i ], [ %28, %.lr.ph7.preheader.i ]
  %indvars10.i = trunc i64 %29 to i32
  %30 = icmp sgt i32 %indvars10.i, 0
  br i1 %30, label %.lr.ph.preheader.i, label %._crit_edge.i

.lr.ph.preheader.i:                               ; preds = %.lr.ph7.i
  %sext.i = shl i64 %29, 32
  %31 = ashr exact i64 %sext.i, 32
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %42, %.lr.ph.preheader.i
  %indvars.iv.i = phi i64 [ 1, %.lr.ph.preheader.i ], [ %indvars.iv.next.i, %42 ]
  %32 = phi i64 [ %31, %.lr.ph.preheader.i ], [ %43, %42 ]
  %33 = add nsw i64 %indvars.iv.i, -1
  %34 = getelementptr i32, ptr %.unpack813, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !3
  %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
  %sext11.i = shl i64 %indvars.iv.next.i, 32
  %36 = ashr exact i64 %sext11.i, 32
  %37 = add nsw i64 %36, -1
  %38 = getelementptr i32, ptr %.unpack813, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !3
  %40 = icmp slt i32 %35, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %.lr.ph.i
  store i32 %39, ptr %34, align 4, !tbaa !3
  store i32 %35, ptr %38, align 4, !tbaa !3
  br label %42

42:                                               ; preds = %41, %.lr.ph.i
  %43 = add nsw i64 %32, -1
  %44 = icmp sgt i64 %32, 1
  br i1 %44, label %.lr.ph.i, label %._crit_edge.i

._crit_edge.i:                                    ; preds = %42, %.lr.ph7.i
  %45 = add nsw i64 %29, -1
  %46 = icmp sgt i64 %29, 1
  br i1 %46, label %.lr.ph7.i, label %_QFPreverse_sort.exit

_QFPreverse_sort.exit:                            ; preds = %._crit_edge.i, %0
  %.unpack825 = load ptr, ptr @_QFEdp.0, align 8, !tbaa !7
  %.unpack832.unpack.unpack834 = load i64, ptr @_QFEdp.8, align 8, !tbaa !7
  %.not = icmp eq ptr %.unpack825, null
  br i1 %.not, label %49, label %.preheader978

.preheader978:                                    ; preds = %_QFPreverse_sort.exit
  %47 = icmp sgt i64 %.unpack832.unpack.unpack834, 0
  br i1 %47, label %.lr.ph.preheader, label %.loopexit979

.lr.ph.preheader:                                 ; preds = %.preheader978
  %48 = shl nuw i64 %.unpack832.unpack.unpack834, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %.unpack825, i8 -1, i64 %48, i1 false), !tbaa !3
  br label %.loopexit979

49:                                               ; preds = %_QFPreverse_sort.exit
  %50 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.e3e03d00bb84f44cd49fcd54d9faa92e, i32 11)
  %.unpack964.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %51 = icmp eq i64 %.unpack832.unpack.unpack834, 0
  %52 = select i1 %51, i64 1, i64 %.unpack964.unpack.unpack
  store ptr null, ptr @_QFEdp.0, align 8, !tbaa !7
  store i64 %52, ptr @_QFEdp.7, align 8, !tbaa !7
  store i64 %.unpack832.unpack.unpack834, ptr @_QFEdp.8, align 8, !tbaa !7
  br label %.loopexit979

.loopexit979:                                     ; preds = %.lr.ph.preheader, %.preheader978, %49
  %.unpack844.unpack.unpack = load i64, ptr @_QFEdp.7, align 8, !tbaa !7
  %53 = sub i64 0, %.unpack844.unpack.unpack
  %54 = getelementptr i32, ptr %.unpack825, i64 %53
  store i32 0, ptr %54, align 4, !tbaa !3
  %55 = load i32, ptr %3, align 4, !tbaa !3
  %56 = icmp sgt i32 %55, 1
  br i1 %56, label %.lr.ph984, label %._crit_edge985

.lr.ph984:                                        ; preds = %.loopexit979
  %57 = zext i32 %55 to i64
  %.unpack909 = load ptr, ptr @_QFEa.0, align 8
  br label %58

58:                                               ; preds = %.lr.ph984, %._crit_edge
  %indvars.iv1030 = phi i64 [ 2, %.lr.ph984 ], [ %indvars.iv.next1031, %._crit_edge ]
  %59 = load i32, ptr %2, align 4, !tbaa !3
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.lr.ph982, label %._crit_edge

.lr.ph982:                                        ; preds = %58
  %61 = zext i32 %59 to i64
  %62 = sub i64 %indvars.iv1030, %.unpack844.unpack.unpack
  %63 = getelementptr i32, ptr %.unpack825, i64 %62
  %64 = trunc i64 %indvars.iv1030 to i32
  br label %65

65:                                               ; preds = %.lr.ph982, %80
  %indvars.iv = phi i64 [ 1, %.lr.ph982 ], [ %indvars.iv.next, %80 ]
  %.0773981 = phi i32 [ -1, %.lr.ph982 ], [ %.1, %80 ]
  %66 = add nsw i64 %indvars.iv, -1
  %67 = getelementptr i32, ptr %.unpack909, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !3
  %69 = sext i32 %68 to i64
  %70 = add nsw i64 %69, -1
  %71 = getelementptr [9 x i32], ptr @_QFEb, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !3
  %73 = sub i32 %64, %72
  %74 = icmp sgt i32 %73, -1
  br i1 %74, label %75, label %80

75:                                               ; preds = %65
  %76 = zext i32 %73 to i64
  %77 = sub i64 %76, %.unpack844.unpack.unpack
  %78 = getelementptr i32, ptr %.unpack825, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !3
  %spec.select = call i32 @llvm.smax.i32(i32 %79, i32 %.0773981)
  br label %80

80:                                               ; preds = %75, %65
  %.1 = phi i32 [ %.0773981, %65 ], [ %spec.select, %75 ]
  %81 = add nuw i32 %.1, 1
  %.inv = icmp sgt i32 %.1, -1
  %spec.select1049 = select i1 %.inv, i32 %81, i32 -1
  store i32 %spec.select1049, ptr %63, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %61
  br i1 %exitcond.not, label %._crit_edge, label %65

._crit_edge:                                      ; preds = %80, %58
  %indvars.iv.next1031 = add nuw nsw i64 %indvars.iv1030, 1
  %exitcond1033.not = icmp eq i64 %indvars.iv1030, %57
  br i1 %exitcond1033.not, label %._crit_edge985.loopexit, label %58

._crit_edge985.loopexit:                          ; preds = %._crit_edge
  %.pre = load i32, ptr %3, align 4, !tbaa !3
  br label %._crit_edge985

._crit_edge985:                                   ; preds = %._crit_edge985.loopexit, %.loopexit979
  %82 = phi i32 [ %.pre, %._crit_edge985.loopexit ], [ %55, %.loopexit979 ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16384) @_QFEanswer, i8 32, i64 16384, i1 false), !tbaa !3
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.lr.ph991.lr.ph, label %._crit_edge985..outer._crit_edge_crit_edge

._crit_edge985..outer._crit_edge_crit_edge:       ; preds = %._crit_edge985
  %.unpack849.pre = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  br label %.outer._crit_edge

.lr.ph991.lr.ph:                                  ; preds = %._crit_edge985
  %84 = load i32, ptr %2, align 4, !tbaa !3
  %85 = icmp sgt i32 %84, 0
  %.unpack873 = load ptr, ptr @_QFEa.0, align 8
  br i1 %85, label %.lr.ph991.us.preheader, label %.loopexit

.lr.ph991.us.preheader:                           ; preds = %.lr.ph991.lr.ph
  %86 = add nuw i32 %84, 1
  %wide.trip.count1041 = zext i32 %86 to i64
  br label %.lr.ph990.us.us.us.preheader

.lr.ph990.us.us.us.preheader:                     ; preds = %.split.us.us, %.lr.ph991.us.preheader
  %.0.ph1008.us = phi i32 [ %101, %.split.us.us ], [ %82, %.lr.ph991.us.preheader ]
  %.0772.ph1007.us = phi i32 [ %102, %.split.us.us ], [ 1, %.lr.ph991.us.preheader ]
  %87 = zext i32 %.0.ph1008.us to i64
  %88 = sub i64 %87, %.unpack844.unpack.unpack
  %89 = getelementptr i32, ptr %.unpack825, i64 %88
  br label %.lr.ph990.us.us.us

.split.us.us:                                     ; preds = %114
  %90 = getelementptr i32, ptr %.unpack873, i64 %105
  %91 = trunc i32 %107 to i8
  %92 = add i8 %91, 48
  %93 = sext i32 %.0772.ph1007.us to i64
  %94 = add nsw i64 %93, -1
  %95 = getelementptr [16384 x [1 x i8]], ptr @_QFEanswer, i64 0, i64 %94
  store i8 %92, ptr %95, align 1
  %96 = load i32, ptr %90, align 4, !tbaa !3
  %97 = sext i32 %96 to i64
  %98 = add nsw i64 %97, -1
  %99 = getelementptr [9 x i32], ptr @_QFEb, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !3
  %101 = sub i32 %.0.ph1008.us, %100
  %102 = add i32 %.0772.ph1007.us, 1
  %103 = icmp sgt i32 %101, 0
  br i1 %103, label %.lr.ph990.us.us.us.preheader, label %.outer._crit_edge

.lr.ph990.us.us.us:                               ; preds = %122, %.lr.ph990.us.us.us.preheader
  br label %104

104:                                              ; preds = %122, %.lr.ph990.us.us.us
  %indvars.iv1038 = phi i64 [ %indvars.iv.next1039, %122 ], [ 1, %.lr.ph990.us.us.us ]
  %105 = add nsw i64 %indvars.iv1038, -1
  %106 = getelementptr i32, ptr %.unpack873, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !3
  %108 = sext i32 %107 to i64
  %109 = add nsw i64 %108, -1
  %110 = getelementptr [9 x i32], ptr @_QFEb, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !3
  %112 = sub i32 %.0.ph1008.us, %111
  %113 = icmp sgt i32 %112, -1
  br i1 %113, label %114, label %122

114:                                              ; preds = %104
  %115 = zext i32 %112 to i64
  %116 = sub i64 %115, %.unpack844.unpack.unpack
  %117 = getelementptr i32, ptr %.unpack825, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !3
  %119 = load i32, ptr %89, align 4, !tbaa !3
  %120 = add i32 %119, -1
  %121 = icmp eq i32 %118, %120
  br i1 %121, label %.split.us.us, label %122

122:                                              ; preds = %114, %104
  %indvars.iv.next1039 = add nuw nsw i64 %indvars.iv1038, 1
  %exitcond1042.not = icmp eq i64 %indvars.iv.next1039, %wide.trip.count1041
  br i1 %exitcond1042.not, label %.lr.ph990.us.us.us, label %104

.loopexit:                                        ; preds = %.lr.ph991.lr.ph, %.loopexit
  br label %.loopexit

.outer._crit_edge:                                ; preds = %.split.us.us, %._crit_edge985..outer._crit_edge_crit_edge
  %.unpack849 = phi ptr [ %.unpack849.pre, %._crit_edge985..outer._crit_edge_crit_edge ], [ %.unpack873, %.split.us.us ]
  %.0772.ph.lcssa = phi i32 [ 1, %._crit_edge985..outer._crit_edge_crit_edge ], [ %102, %.split.us.us ]
  call void @free(ptr %.unpack849)
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 0, ptr @_QFEa.8, align 8, !tbaa !7
  call void @free(ptr %.unpack825)
  store ptr null, ptr @_QFEdp.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEdp.7, align 8, !tbaa !7
  store i64 0, ptr @_QFEdp.8, align 8, !tbaa !7
  %123 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.e3e03d00bb84f44cd49fcd54d9faa92e, i32 42)
  %124 = call i32 @llvm.smax.i32(i32 %.0772.ph.lcssa, i32 0)
  %125 = zext i32 %124 to i64
  %126 = call i1 @_FortranAioOutputAscii(ptr %123, ptr nonnull @_QFEanswer, i64 %125)
  %127 = call i32 @_FortranAioEndIoStatement(ptr %123)
  %128 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite)
define void @_QFPreverse_sort(ptr nocapture readonly %0, ptr nocapture %1) local_unnamed_addr #3 {
  %3 = load i32, ptr %0, align 4, !tbaa !3
  %4 = add i32 %3, -1
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph7.preheader, label %._crit_edge8

.lr.ph7.preheader:                                ; preds = %2
  %6 = zext i32 %4 to i64
  br label %.lr.ph7

.lr.ph7:                                          ; preds = %.lr.ph7.preheader, %._crit_edge
  %7 = phi i64 [ %23, %._crit_edge ], [ %6, %.lr.ph7.preheader ]
  %indvars10 = trunc i64 %7 to i32
  %8 = icmp sgt i32 %indvars10, 0
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph7
  %sext = shl i64 %7, 32
  %9 = ashr exact i64 %sext, 32
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %20
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %20 ]
  %10 = phi i64 [ %9, %.lr.ph.preheader ], [ %21, %20 ]
  %11 = add nsw i64 %indvars.iv, -1
  %12 = getelementptr i32, ptr %1, i64 %11
  %13 = load i32, ptr %12, align 4, !tbaa !3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %sext11 = shl i64 %indvars.iv.next, 32
  %14 = ashr exact i64 %sext11, 32
  %15 = add nsw i64 %14, -1
  %16 = getelementptr i32, ptr %1, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !3
  %18 = icmp slt i32 %13, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %.lr.ph
  store i32 %17, ptr %12, align 4, !tbaa !3
  store i32 %13, ptr %16, align 4, !tbaa !3
  br label %20

20:                                               ; preds = %19, %.lr.ph
  %21 = add nsw i64 %10, -1
  %22 = icmp sgt i64 %10, 1
  br i1 %22, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %20, %.lr.ph7
  %23 = add nsw i64 %7, -1
  %24 = icmp sgt i64 %7, 1
  br i1 %24, label %.lr.ph7, label %._crit_edge8

._crit_edge8:                                     ; preds = %._crit_edge, %2
  ret void
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
define void @_QFPswap(ptr nocapture %0, ptr nocapture %1) local_unnamed_addr #4 {
  %3 = load i32, ptr %0, align 4, !tbaa !3
  %4 = load i32, ptr %1, align 4, !tbaa !3
  store i32 %4, ptr %0, align 4, !tbaa !3
  store i32 %3, ptr %1, align 4, !tbaa !3
  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 @_FortranAioOutputAscii(ptr, 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) #5

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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 norecurse nosync nounwind memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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}
