program kadai
    implicit none
integer  ::  n
integer,allocatable  ::  a(:,:)
integer,allocatable  ::  now(:)
integer,allocatable  ::  rest(:)
integer  ::  i,j,move,day,num,for

read(*,*) n
allocate(a(n,n-1))
allocate(now(n))
allocate(rest(n))

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

now=1
rest=0
move=0
num=0
day=1

do j=1,n*n
    do i=1,n
    if(now(i)<n) then
        for=a(i,now(i))

        if (now(for)>n-1) then
            write(*,*) -1
            stop
        end if

        if (a(for,now(for))==i .and. rest(for)==0 .and. rest(i)==0) then
            !write(*,*) i,"vs",for
            now(i)=now(i)+1
            now(for)=now(for)+1
            if (now(i)>n .or. now(for)>n) then
                write(*,*) -1
                !write(*,*) now,num
                stop
            end if
            move=1
            num=num+1
            rest(i)=1
            rest(for)=1
        end if
        if (num==n*(n-1)/2) then
            write(*,*) day
            stop
        end if
    end if
    end do
    if (move==0) then
        write(*,*) -1
        stop
    end if
    day=day+1
    rest=0
end do

write(*,*) -1


stop
contains

end program kadai

; 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
@_QFEa.11 = internal unnamed_addr global i64 0
@_QFEnow.0 = internal unnamed_addr global ptr null
@_QFEnow.7 = internal unnamed_addr global i64 1
@_QFEnow.8 = internal unnamed_addr global i64 0
@_QFErest.0 = internal unnamed_addr global ptr null
@_QFErest.7 = internal unnamed_addr global i64 1
@_QFErest.8 = internal unnamed_addr global i64 0
@_QQcl.09ac1948f51e0a14bb212304abad1493 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3396/source.f\00"
@_QQcl.16373402fa3425c6e46827601abb88fa = linkonce constant [76 x i8] c"array left hand side must be allocated when the right hand side is a scalar\00"
@_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: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 9)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %6 = load i32, ptr %2, align 4, !tbaa !3
  %7 = add i32 %6, -1
  %8 = call i32 @llvm.smax.i32(i32 %6, i32 0)
  %9 = zext i32 %8 to i64
  %10 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %11 = zext i32 %10 to i64
  %12 = shl nuw nsw i64 %9, 2
  %13 = mul nuw i64 %12, %11
  %14 = call ptr @malloc(i64 %13)
  store ptr %14, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEa.8, align 8, !tbaa !7
  store i64 %11, ptr @_QFEa.11, align 8, !tbaa !7
  %15 = call ptr @malloc(i64 %12)
  store ptr %15, ptr @_QFEnow.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEnow.7, align 8, !tbaa !7
  store i64 %9, ptr @_QFEnow.8, align 8, !tbaa !7
  %16 = call ptr @malloc(i64 %12)
  store ptr %16, ptr @_QFErest.0, align 8, !tbaa !7
  store i64 1, ptr @_QFErest.7, align 8, !tbaa !7
  store i64 %9, ptr @_QFErest.8, align 8, !tbaa !7
  %17 = icmp sgt i32 %6, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %18 = zext i32 %6 to i64
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 6
  %.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
  %.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
  %.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
  br label %19

19:                                               ; preds = %.lr.ph, %19
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %19 ]
  %20 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 15)
  %.unpack882 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack889.unpack.unpack892 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %.unpack889.unpack890.unpack895 = load i64, ptr @_QFEa.11, align 8, !tbaa !7
  %21 = add nsw i64 %indvars.iv, -1
  %22 = shl i64 %.unpack889.unpack.unpack892, 2
  %23 = call i64 @llvm.smax.i64(i64 %.unpack889.unpack890.unpack895, i64 0)
  %24 = getelementptr i32, ptr %.unpack882, i64 %21
  store ptr %24, ptr %1, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  store i64 %23, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 %22, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %25 = call i1 @_FortranAioInputDescriptor(ptr %20, ptr nonnull %1)
  %26 = call i32 @_FortranAioEndIoStatement(ptr %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %18
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %19

._crit_edge.loopexit:                             ; preds = %19
  %.unpack.pre = load ptr, ptr @_QFEnow.0, align 8, !tbaa !7
  %.unpack700.unpack.unpack702.pre = load i64, ptr @_QFEnow.8, align 8, !tbaa !7
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %.unpack700.unpack.unpack702 = phi i64 [ %.unpack700.unpack.unpack702.pre, %._crit_edge.loopexit ], [ %9, %0 ]
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.loopexit ], [ %15, %0 ]
  %.not = icmp eq ptr %.unpack, null
  br i1 %.not, label %34, label %.preheader903

.preheader903:                                    ; preds = %._crit_edge
  %27 = icmp sgt i64 %.unpack700.unpack.unpack702, 0
  br i1 %27, label %.lr.ph915.preheader, label %.loopexit904

.lr.ph915.preheader:                              ; preds = %.preheader903
  %min.iters.check = icmp ult i64 %.unpack700.unpack.unpack702, 8
  br i1 %min.iters.check, label %.lr.ph915.preheader962, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph915.preheader
  %n.vec = and i64 %.unpack700.unpack.unpack702, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %28 = getelementptr i32, ptr %.unpack, i64 %index
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %28, align 4, !tbaa !3
  %29 = getelementptr i32, ptr %28, i64 4
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %29, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %30 = icmp eq i64 %index.next, %n.vec
  br i1 %30, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %.unpack700.unpack.unpack702, %n.vec
  br i1 %cmp.n, label %.loopexit904, label %.lr.ph915.preheader962

.lr.ph915.preheader962:                           ; preds = %.lr.ph915.preheader, %middle.block
  %.ph = phi i64 [ 0, %.lr.ph915.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph915

.lr.ph915:                                        ; preds = %.lr.ph915.preheader962, %.lr.ph915
  %31 = phi i64 [ %32, %.lr.ph915 ], [ %.ph, %.lr.ph915.preheader962 ]
  %32 = add nuw nsw i64 %31, 1
  %33 = getelementptr i32, ptr %.unpack, i64 %31
  store i32 1, ptr %33, align 4, !tbaa !3
  %exitcond938.not = icmp eq i64 %32, %.unpack700.unpack.unpack702
  br i1 %exitcond938.not, label %.loopexit904, label %.lr.ph915, !llvm.loop !12

34:                                               ; preds = %._crit_edge
  %35 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 18)
  %.unpack868.unpack.unpack = load i64, ptr @_QFEnow.7, align 8, !tbaa !7
  %36 = icmp eq i64 %.unpack700.unpack.unpack702, 0
  %37 = select i1 %36, i64 1, i64 %.unpack868.unpack.unpack
  store ptr null, ptr @_QFEnow.0, align 8, !tbaa !7
  store i64 %37, ptr @_QFEnow.7, align 8, !tbaa !7
  store i64 %.unpack700.unpack.unpack702, ptr @_QFEnow.8, align 8, !tbaa !7
  br label %.loopexit904

.loopexit904:                                     ; preds = %.lr.ph915, %middle.block, %.preheader903, %34
  %.unpack705 = load ptr, ptr @_QFErest.0, align 8, !tbaa !7
  %.unpack712.unpack.unpack714 = load i64, ptr @_QFErest.8, align 8, !tbaa !7
  %.not717 = icmp eq ptr %.unpack705, null
  br i1 %.not717, label %40, label %.preheader901

.preheader901:                                    ; preds = %.loopexit904
  %38 = icmp sgt i64 %.unpack712.unpack.unpack714, 0
  br i1 %38, label %.lr.ph916.preheader, label %.loopexit902

.lr.ph916.preheader:                              ; preds = %.preheader901
  %39 = shl nuw i64 %.unpack712.unpack.unpack714, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %.unpack705, i8 0, i64 %39, i1 false), !tbaa !3
  br label %.loopexit902

40:                                               ; preds = %.loopexit904
  %41 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 19)
  %.unpack847.unpack.unpack = load i64, ptr @_QFErest.7, align 8, !tbaa !7
  %42 = icmp eq i64 %.unpack712.unpack.unpack714, 0
  %43 = select i1 %42, i64 1, i64 %.unpack847.unpack.unpack
  store ptr null, ptr @_QFErest.0, align 8, !tbaa !7
  store i64 %43, ptr @_QFErest.7, align 8, !tbaa !7
  store i64 %.unpack712.unpack.unpack714, ptr @_QFErest.8, align 8, !tbaa !7
  br label %.loopexit902

.loopexit902:                                     ; preds = %.lr.ph916.preheader, %.preheader901, %40
  %44 = load i32, ptr %2, align 4, !tbaa !3
  %45 = mul i32 %44, %44
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %.lr.ph931.preheader, label %._crit_edge932

.lr.ph931.preheader:                              ; preds = %.loopexit902
  %47 = icmp sgt i64 %.unpack712.unpack.unpack714, 0
  %48 = shl nuw i64 %.unpack712.unpack.unpack714, 2
  %49 = icmp eq i64 %.unpack712.unpack.unpack714, 0
  br label %.lr.ph931

.lr.ph931thread-pre-split:                        ; preds = %.loopexit
  %.pr = load i32, ptr %2, align 4, !tbaa !3
  br label %.lr.ph931

.lr.ph931:                                        ; preds = %.lr.ph931thread-pre-split, %.lr.ph931.preheader
  %50 = phi i32 [ %.pr, %.lr.ph931thread-pre-split ], [ %44, %.lr.ph931.preheader ]
  %.unpack780 = phi ptr [ %.unpack718, %.lr.ph931thread-pre-split ], [ %.unpack705, %.lr.ph931.preheader ]
  %.0929 = phi i32 [ %.1.lcssa, %.lr.ph931thread-pre-split ], [ 0, %.lr.ph931.preheader ]
  %.0648928 = phi i32 [ 1, %.lr.ph931thread-pre-split ], [ 0, %.lr.ph931.preheader ]
  %.0655927 = phi i32 [ %133, %.lr.ph931thread-pre-split ], [ 1, %.lr.ph931.preheader ]
  %51 = icmp sgt i32 %50, 0
  br i1 %51, label %.lr.ph922, label %._crit_edge923

.lr.ph922:                                        ; preds = %.lr.ph931
  %.unpack752 = load ptr, ptr @_QFEnow.0, align 8, !tbaa !7
  %.unpack759.unpack.unpack = load i64, ptr @_QFEnow.7, align 8, !tbaa !7
  %.unpack764 = load ptr, ptr @_QFEa.0, align 8
  %.unpack771.unpack.unpack774 = load i64, ptr @_QFEa.8, align 8
  %.unpack787.unpack.unpack = load i64, ptr @_QFErest.7, align 8
  %52 = add nuw i32 %50, 1
  %wide.trip.count = zext i32 %52 to i64
  br label %53

53:                                               ; preds = %.lr.ph922, %123
  %54 = phi i32 [ %50, %.lr.ph922 ], [ %124, %123 ]
  %55 = phi i32 [ %50, %.lr.ph922 ], [ %125, %123 ]
  %indvars.iv939 = phi i64 [ 1, %.lr.ph922 ], [ %indvars.iv.next940, %123 ]
  %.1920 = phi i32 [ %.0929, %.lr.ph922 ], [ %.3, %123 ]
  %.1649919 = phi i32 [ %.0648928, %.lr.ph922 ], [ %.3651, %123 ]
  %56 = sub i64 %indvars.iv939, %.unpack759.unpack.unpack
  %57 = getelementptr i32, ptr %.unpack752, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !3
  %59 = icmp slt i32 %58, %55
  br i1 %59, label %60, label %123

60:                                               ; preds = %53
  %61 = add nsw i64 %indvars.iv939, -1
  %62 = sext i32 %58 to i64
  %63 = add nsw i64 %62, -1
  %64 = mul i64 %63, %.unpack771.unpack.unpack774
  %65 = add i64 %61, %64
  %66 = getelementptr i32, ptr %.unpack764, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !3
  %68 = sext i32 %67 to i64
  %69 = sub i64 %68, %.unpack759.unpack.unpack
  %70 = getelementptr i32, ptr %.unpack752, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !3
  %.not900 = icmp slt i32 %71, %55
  br i1 %.not900, label %77, label %72

72:                                               ; preds = %60
  %73 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 30)
  %74 = call i1 @_FortranAioOutputInteger32(ptr %73, i32 -1)
  %75 = call i32 @_FortranAioEndIoStatement(ptr %73)
  %76 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

77:                                               ; preds = %60
  %78 = add nsw i64 %68, -1
  %79 = sext i32 %71 to i64
  %80 = add nsw i64 %79, -1
  %81 = mul i64 %80, %.unpack771.unpack.unpack774
  %82 = add i64 %78, %81
  %83 = getelementptr i32, ptr %.unpack764, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !3
  %85 = zext i32 %84 to i64
  %86 = icmp eq i64 %indvars.iv939, %85
  %87 = sub i64 %68, %.unpack787.unpack.unpack
  %88 = getelementptr i32, ptr %.unpack780, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !3
  %90 = sub i64 %indvars.iv939, %.unpack787.unpack.unpack
  %91 = getelementptr i32, ptr %.unpack780, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !3
  %93 = or i32 %92, %89
  %94 = icmp eq i32 %93, 0
  %95 = and i1 %86, %94
  br i1 %95, label %96, label %112

96:                                               ; preds = %77
  %97 = add nsw i32 %58, 1
  store i32 %97, ptr %57, align 4, !tbaa !3
  %98 = load i32, ptr %70, align 4, !tbaa !3
  %99 = add i32 %98, 1
  store i32 %99, ptr %70, align 4, !tbaa !3
  %100 = load i32, ptr %57, align 4, !tbaa !3
  %101 = load i32, ptr %2, align 4, !tbaa !3
  %102 = icmp sgt i32 %100, %101
  %103 = icmp sgt i32 %99, %101
  %104 = or i1 %102, %103
  br i1 %104, label %105, label %110

105:                                              ; preds = %96
  %106 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 39)
  %107 = call i1 @_FortranAioOutputInteger32(ptr %106, i32 -1)
  %108 = call i32 @_FortranAioEndIoStatement(ptr %106)
  %109 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

110:                                              ; preds = %96
  %111 = add i32 %.1920, 1
  store i32 1, ptr %91, align 4, !tbaa !3
  store i32 1, ptr %88, align 4, !tbaa !3
  %.pre = load i32, ptr %2, align 4, !tbaa !3
  br label %112

112:                                              ; preds = %110, %77
  %113 = phi i32 [ %.pre, %110 ], [ %54, %77 ]
  %.2650 = phi i32 [ 1, %110 ], [ %.1649919, %77 ]
  %.2 = phi i32 [ %111, %110 ], [ %.1920, %77 ]
  %114 = add i32 %113, -1
  %115 = mul i32 %114, %113
  %116 = sdiv i32 %115, 2
  %117 = icmp eq i32 %.2, %116
  br i1 %117, label %118, label %123

118:                                              ; preds = %112
  %119 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 49)
  %120 = call i1 @_FortranAioOutputInteger32(ptr %119, i32 %.0655927)
  %121 = call i32 @_FortranAioEndIoStatement(ptr %119)
  %122 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

123:                                              ; preds = %112, %53
  %124 = phi i32 [ %113, %112 ], [ %54, %53 ]
  %125 = phi i32 [ %113, %112 ], [ %55, %53 ]
  %.3651 = phi i32 [ %.2650, %112 ], [ %.1649919, %53 ]
  %.3 = phi i32 [ %.2, %112 ], [ %.1920, %53 ]
  %indvars.iv.next940 = add nuw nsw i64 %indvars.iv939, 1
  %exitcond942.not = icmp eq i64 %indvars.iv.next940, %wide.trip.count
  br i1 %exitcond942.not, label %._crit_edge923, label %53

._crit_edge923:                                   ; preds = %123, %.lr.ph931
  %.1649.lcssa = phi i32 [ %.0648928, %.lr.ph931 ], [ %.3651, %123 ]
  %.1.lcssa = phi i32 [ %.0929, %.lr.ph931 ], [ %.3, %123 ]
  %126 = icmp eq i32 %.1649.lcssa, 0
  br i1 %126, label %127, label %132

127:                                              ; preds = %._crit_edge923
  %128 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 55)
  %129 = call i1 @_FortranAioOutputInteger32(ptr %128, i32 -1)
  %130 = call i32 @_FortranAioEndIoStatement(ptr %128)
  %131 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

132:                                              ; preds = %._crit_edge923
  %133 = add nuw i32 %.0655927, 1
  %.unpack718 = load ptr, ptr @_QFErest.0, align 8, !tbaa !7
  %.not730 = icmp eq ptr %.unpack718, null
  br i1 %.not730, label %134, label %.preheader

.preheader:                                       ; preds = %132
  br i1 %47, label %.lr.ph925.preheader, label %.loopexit

.lr.ph925.preheader:                              ; preds = %.preheader
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %.unpack718, i8 0, i64 %48, i1 false), !tbaa !3
  br label %.loopexit

134:                                              ; preds = %132
  %135 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 59)
  %.unpack738.unpack.unpack = load i64, ptr @_QFErest.7, align 8, !tbaa !7
  %136 = select i1 %49, i64 1, i64 %.unpack738.unpack.unpack
  store ptr null, ptr @_QFErest.0, align 8, !tbaa !7
  store i64 %136, ptr @_QFErest.7, align 8, !tbaa !7
  store i64 %.unpack712.unpack.unpack714, ptr @_QFErest.8, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph925.preheader, %.preheader, %134
  %exitcond943.not = icmp eq i32 %.0655927, %45
  br i1 %exitcond943.not, label %._crit_edge932, label %.lr.ph931thread-pre-split

._crit_edge932:                                   ; preds = %.loopexit, %.loopexit902
  %137 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.09ac1948f51e0a14bb212304abad1493, i32 62)
  %138 = call i1 @_FortranAioOutputInteger32(ptr %137, i32 -1)
  %139 = call i32 @_FortranAioEndIoStatement(ptr %137)
  %140 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) 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) #2

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { noreturn }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !11, !10}
