integer N
integer,allocatable,dimension(:)::b
integer,allocatable,dimension(:)::ans
read*,N
allocate(b(N),ans(N))
read*,b
do i=N,1,-1
  do j=i,0,-1
    if(j==0)then
      print"(i0)",-1
      stop
    endif
    if(b(j)==j)then
      ans(i)=j
      b=[b(:j-1),b(j+1:)]
      exit
    endif
  end do
end do

print"(i0)",ans

end
; 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"

@_QFEans.0 = internal unnamed_addr global ptr null
@_QFEans.8 = internal unnamed_addr global i64 0
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEb.8 = internal unnamed_addr global i64 0
@_QQcl.e2c5c6d09f6943a0f6b90f83267ca21a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4682/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

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca i32, align 4
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e2c5c6d09f6943a0f6b90f83267ca21a, i32 4)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = load i32, ptr %3, align 4, !tbaa !3
  %8 = call i32 @llvm.smax.i32(i32 %7, i32 0)
  %9 = zext i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 2
  %11 = call ptr @malloc(i64 %10)
  store ptr %11, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEb.8, align 8, !tbaa !7
  %12 = call ptr @malloc(i64 %10)
  store ptr %12, ptr @_QFEans.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEans.8, align 8, !tbaa !7
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.e2c5c6d09f6943a0f6b90f83267ca21a, i32 6)
  %.unpack = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack380.unpack.unpack382 = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %2, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, 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 %2, 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 %2, 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 %2, 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 %2, 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 %2, 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 %2, 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 %2, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack380.unpack.unpack382, 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 %2, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %14 = call i1 @_FortranAioInputDescriptor(ptr %13, ptr nonnull %2)
  %15 = call i32 @_FortranAioEndIoStatement(ptr %13)
  %16 = load i32, ptr %3, align 4, !tbaa !3
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph487, label %._crit_edge488

.lr.ph487:                                        ; preds = %0
  %_QFEb.promoted = load ptr, ptr @_QFEb.0, align 8
  %.promoted = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  %.unpack409 = load ptr, ptr @_QFEans.0, align 8
  %18 = zext i32 %16 to i64
  %19 = add i32 %16, 1
  br label %20

20:                                               ; preds = %.lr.ph487, %.loopexit
  %indvar = phi i32 [ 0, %.lr.ph487 ], [ %indvar.next, %.loopexit ]
  %indvars.iv = phi i64 [ %18, %.lr.ph487 ], [ %indvars.iv.next, %.loopexit ]
  %21 = phi i64 [ %.promoted, %.lr.ph487 ], [ %150, %.loopexit ]
  %22 = phi ptr [ %_QFEb.promoted, %.lr.ph487 ], [ %149, %.loopexit ]
  %23 = ptrtoint ptr %22 to i64
  %24 = sub i32 %19, %indvar
  %25 = sext i32 %24 to i64
  %26 = shl nsw i64 %25, 2
  %27 = ptrtoint ptr %22 to i64
  %28 = icmp ult i64 %indvars.iv, 2147483647
  br i1 %28, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %20
  %29 = trunc i64 %indvars.iv to i32
  %.neg = add nuw nsw i32 %29, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %145
  %indvar524 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvar.next525, %145 ]
  %.0473 = phi i32 [ %29, %.lr.ph.preheader ], [ %147, %145 ]
  %.0347472 = phi i32 [ %.neg, %.lr.ph.preheader ], [ %146, %145 ]
  %30 = icmp eq i32 %.0473, 0
  br i1 %30, label %31, label %36

31:                                               ; preds = %.lr.ph
  %32 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.e2c5c6d09f6943a0f6b90f83267ca21a, i32 10)
  %33 = call i1 @_FortranAioOutputInteger32(ptr %32, i32 -1)
  %34 = call i32 @_FortranAioEndIoStatement(ptr %32)
  %35 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

36:                                               ; preds = %.lr.ph
  %37 = sext i32 %.0473 to i64
  %38 = add nsw i64 %37, -1
  %39 = getelementptr i32, ptr %22, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !3
  %41 = icmp eq i32 %40, %.0473
  br i1 %41, label %42, label %145

42:                                               ; preds = %36
  %43 = add i64 %indvars.iv, -1
  %44 = getelementptr i32, ptr %.unpack409, i64 %43
  store i32 %.0473, ptr %44, align 4, !tbaa !3
  %45 = call dereferenceable_or_null(128) ptr @malloc(i64 128)
  %46 = add i32 %.0473, -1
  %47 = call i32 @llvm.smax.i32(i32 %46, i32 0)
  %48 = zext i32 %47 to i64
  %49 = shl nuw nsw i64 %48, 2
  %50 = call ptr @malloc(i64 %49)
  %.not489 = icmp slt i32 %46, 1
  br i1 %.not489, label %._crit_edge, label %.lr.ph474.preheader

.lr.ph474.preheader:                              ; preds = %42
  %51 = ptrtoint ptr %50 to i64
  %min.iters.check548 = icmp ult i32 %47, 8
  %52 = sub i64 %51, %23
  %diff.check545 = icmp ult i64 %52, 32
  %or.cond = select i1 %min.iters.check548, i1 true, i1 %diff.check545
  br i1 %or.cond, label %.lr.ph474.preheader571, label %vector.ph549

vector.ph549:                                     ; preds = %.lr.ph474.preheader
  %n.vec551 = and i64 %48, 2147483640
  %ind.end552 = and i64 %48, 7
  br label %vector.body556

vector.body556:                                   ; preds = %vector.body556, %vector.ph549
  %index557 = phi i64 [ 0, %vector.ph549 ], [ %index.next560, %vector.body556 ]
  %53 = getelementptr i32, ptr %22, i64 %index557
  %wide.load558 = load <4 x i32>, ptr %53, align 4, !tbaa !3
  %54 = getelementptr i32, ptr %53, i64 4
  %wide.load559 = load <4 x i32>, ptr %54, align 4, !tbaa !3
  %55 = getelementptr i32, ptr %50, i64 %index557
  store <4 x i32> %wide.load558, ptr %55, align 4, !tbaa !3
  %56 = getelementptr i32, ptr %55, i64 4
  store <4 x i32> %wide.load559, ptr %56, align 4, !tbaa !3
  %index.next560 = add nuw i64 %index557, 8
  %57 = icmp eq i64 %index.next560, %n.vec551
  br i1 %57, label %middle.block546, label %vector.body556, !llvm.loop !9

middle.block546:                                  ; preds = %vector.body556
  %cmp.n555 = icmp eq i64 %n.vec551, %48
  br i1 %cmp.n555, label %._crit_edge, label %.lr.ph474.preheader571

.lr.ph474.preheader571:                           ; preds = %.lr.ph474.preheader, %middle.block546
  %.ph572 = phi i64 [ %48, %.lr.ph474.preheader ], [ %ind.end552, %middle.block546 ]
  %.ph573 = phi i64 [ 0, %.lr.ph474.preheader ], [ %n.vec551, %middle.block546 ]
  br label %.lr.ph474

.lr.ph474:                                        ; preds = %.lr.ph474.preheader571, %.lr.ph474
  %58 = phi i64 [ %64, %.lr.ph474 ], [ %.ph572, %.lr.ph474.preheader571 ]
  %59 = phi i64 [ %62, %.lr.ph474 ], [ %.ph573, %.lr.ph474.preheader571 ]
  %60 = getelementptr i32, ptr %22, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !3
  %62 = add nuw nsw i64 %59, 1
  %63 = getelementptr i32, ptr %50, i64 %59
  store i32 %61, ptr %63, align 4, !tbaa !3
  %64 = add nsw i64 %58, -1
  %65 = icmp ugt i64 %58, 1
  br i1 %65, label %.lr.ph474, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph474, %middle.block546, %42
  %66 = icmp ugt i32 %47, 31
  br i1 %66, label %67, label %71

67:                                               ; preds = %._crit_edge
  %68 = shl nuw nsw i64 %48, 1
  %69 = shl nuw nsw i64 %48, 3
  %70 = call ptr @realloc(ptr %45, i64 %69)
  br label %71

71:                                               ; preds = %67, %._crit_edge
  %.0348 = phi i64 [ %68, %67 ], [ 32, %._crit_edge ]
  %72 = phi ptr [ %70, %67 ], [ %45, %._crit_edge ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %72, ptr align 1 %50, i64 %49, i1 false)
  %73 = add i32 %.0473, 1
  %74 = sext i32 %73 to i64
  %75 = sub nsw i64 1, %74
  %76 = add i64 %75, %21
  %77 = call i64 @llvm.smax.i64(i64 %76, i64 0)
  %78 = shl i64 %77, 2
  %79 = call ptr @malloc(i64 %78)
  %80 = ptrtoint ptr %79 to i64
  %.not490 = icmp slt i64 %76, 1
  br i1 %.not490, label %._crit_edge477, label %.lr.ph476

.lr.ph476:                                        ; preds = %71
  %81 = add nsw i64 %74, -1
  %min.iters.check531 = icmp ult i64 %77, 16
  br i1 %min.iters.check531, label %scalar.ph530.preheader, label %vector.memcheck523

vector.memcheck523:                               ; preds = %.lr.ph476
  %82 = add i64 %26, %27
  %83 = add i64 %82, -4
  %84 = shl i64 %indvar524, 2
  %.neg561 = sub i64 %84, %83
  %85 = add i64 %.neg561, %80
  %diff.check528 = icmp ult i64 %85, 32
  br i1 %diff.check528, label %scalar.ph530.preheader, label %vector.ph532

vector.ph532:                                     ; preds = %vector.memcheck523
  %n.vec534 = and i64 %77, 9223372036854775800
  %ind.end535 = and i64 %77, 7
  br label %vector.body539

vector.body539:                                   ; preds = %vector.body539, %vector.ph532
  %index540 = phi i64 [ 0, %vector.ph532 ], [ %index.next543, %vector.body539 ]
  %86 = add i64 %81, %index540
  %87 = getelementptr i32, ptr %22, i64 %86
  %wide.load541 = load <4 x i32>, ptr %87, align 4, !tbaa !3
  %88 = getelementptr i32, ptr %87, i64 4
  %wide.load542 = load <4 x i32>, ptr %88, align 4, !tbaa !3
  %89 = getelementptr i32, ptr %79, i64 %index540
  store <4 x i32> %wide.load541, ptr %89, align 4, !tbaa !3
  %90 = getelementptr i32, ptr %89, i64 4
  store <4 x i32> %wide.load542, ptr %90, align 4, !tbaa !3
  %index.next543 = add nuw i64 %index540, 8
  %91 = icmp eq i64 %index.next543, %n.vec534
  br i1 %91, label %middle.block529, label %vector.body539, !llvm.loop !13

middle.block529:                                  ; preds = %vector.body539
  %cmp.n538 = icmp eq i64 %77, %n.vec534
  br i1 %cmp.n538, label %._crit_edge477, label %scalar.ph530.preheader

scalar.ph530.preheader:                           ; preds = %vector.memcheck523, %.lr.ph476, %middle.block529
  %.ph569 = phi i64 [ %77, %vector.memcheck523 ], [ %77, %.lr.ph476 ], [ %ind.end535, %middle.block529 ]
  %.ph570 = phi i64 [ 0, %vector.memcheck523 ], [ 0, %.lr.ph476 ], [ %n.vec534, %middle.block529 ]
  br label %scalar.ph530

scalar.ph530:                                     ; preds = %scalar.ph530.preheader, %scalar.ph530
  %92 = phi i64 [ %99, %scalar.ph530 ], [ %.ph569, %scalar.ph530.preheader ]
  %93 = phi i64 [ %97, %scalar.ph530 ], [ %.ph570, %scalar.ph530.preheader ]
  %94 = add i64 %81, %93
  %95 = getelementptr i32, ptr %22, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !3
  %97 = add nuw nsw i64 %93, 1
  %98 = getelementptr i32, ptr %79, i64 %93
  store i32 %96, ptr %98, align 4, !tbaa !3
  %99 = add nsw i64 %92, -1
  %100 = icmp ugt i64 %92, 1
  br i1 %100, label %scalar.ph530, label %._crit_edge477, !llvm.loop !14

._crit_edge477:                                   ; preds = %scalar.ph530, %middle.block529, %71
  %101 = add nuw i64 %77, %48
  %.not = icmp sgt i64 %.0348, %101
  br i1 %.not, label %105, label %102

102:                                              ; preds = %._crit_edge477
  %103 = shl i64 %101, 3
  %104 = call ptr @realloc(ptr %72, i64 %103)
  br label %105

105:                                              ; preds = %._crit_edge477, %102
  %106 = phi ptr [ %104, %102 ], [ %72, %._crit_edge477 ]
  %107 = ptrtoint ptr %106 to i64
  %108 = getelementptr i32, ptr %106, i64 %48
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %108, ptr align 1 %79, i64 %78, i1 false)
  %.not467 = icmp eq i64 %21, %101
  br i1 %.not467, label %.preheader, label %116

.preheader:                                       ; preds = %105
  %109 = icmp sgt i64 %21, 0
  br i1 %109, label %.lr.ph480.preheader, label %._crit_edge481

.lr.ph480.preheader:                              ; preds = %.preheader
  %min.iters.check = icmp ult i64 %21, 8
  %110 = sub i64 %27, %107
  %diff.check = icmp ult i64 %110, 32
  %or.cond562 = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond562, label %.lr.ph480.preheader564, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph480.preheader
  %n.vec = and i64 %21, -8
  %ind.end = and i64 %21, 7
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %111 = getelementptr i32, ptr %106, i64 %index
  %wide.load = load <4 x i32>, ptr %111, align 4, !tbaa !3
  %112 = getelementptr i32, ptr %111, i64 4
  %wide.load505 = load <4 x i32>, ptr %112, align 4, !tbaa !3
  %113 = getelementptr i32, ptr %22, i64 %index
  store <4 x i32> %wide.load, ptr %113, align 4, !tbaa !3
  %114 = getelementptr i32, ptr %113, i64 4
  store <4 x i32> %wide.load505, ptr %114, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %115 = icmp eq i64 %index.next, %n.vec
  br i1 %115, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %21, %n.vec
  br i1 %cmp.n, label %._crit_edge481, label %.lr.ph480.preheader564

.lr.ph480.preheader564:                           ; preds = %.lr.ph480.preheader, %middle.block
  %.ph = phi i64 [ %21, %.lr.ph480.preheader ], [ %ind.end, %middle.block ]
  %.ph565 = phi i64 [ 0, %.lr.ph480.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph480

116:                                              ; preds = %105
  %117 = shl i64 %101, 2
  %118 = call ptr @malloc(i64 %117)
  %119 = icmp sgt i64 %101, 0
  br i1 %119, label %.lr.ph479.preheader, label %.thread

.lr.ph479.preheader:                              ; preds = %116
  %120 = ptrtoint ptr %118 to i64
  %min.iters.check510 = icmp ult i64 %101, 8
  %121 = sub i64 %120, %107
  %diff.check507 = icmp ult i64 %121, 32
  %or.cond563 = or i1 %min.iters.check510, %diff.check507
  br i1 %or.cond563, label %.lr.ph479.preheader566, label %vector.ph511

vector.ph511:                                     ; preds = %.lr.ph479.preheader
  %n.vec513 = and i64 %101, -8
  %ind.end514 = and i64 %101, 7
  br label %vector.body518

vector.body518:                                   ; preds = %vector.body518, %vector.ph511
  %index519 = phi i64 [ 0, %vector.ph511 ], [ %index.next522, %vector.body518 ]
  %122 = getelementptr i32, ptr %106, i64 %index519
  %wide.load520 = load <4 x i32>, ptr %122, align 4, !tbaa !3
  %123 = getelementptr i32, ptr %122, i64 4
  %wide.load521 = load <4 x i32>, ptr %123, align 4, !tbaa !3
  %124 = getelementptr i32, ptr %118, i64 %index519
  store <4 x i32> %wide.load520, ptr %124, align 4, !tbaa !3
  %125 = getelementptr i32, ptr %124, i64 4
  store <4 x i32> %wide.load521, ptr %125, align 4, !tbaa !3
  %index.next522 = add nuw i64 %index519, 8
  %126 = icmp eq i64 %index.next522, %n.vec513
  br i1 %126, label %middle.block508, label %vector.body518, !llvm.loop !16

middle.block508:                                  ; preds = %vector.body518
  %cmp.n517 = icmp eq i64 %101, %n.vec513
  br i1 %cmp.n517, label %.thread, label %.lr.ph479.preheader566

.lr.ph479.preheader566:                           ; preds = %.lr.ph479.preheader, %middle.block508
  %.ph567 = phi i64 [ %101, %.lr.ph479.preheader ], [ %ind.end514, %middle.block508 ]
  %.ph568 = phi i64 [ 0, %.lr.ph479.preheader ], [ %n.vec513, %middle.block508 ]
  br label %.lr.ph479

.lr.ph479:                                        ; preds = %.lr.ph479.preheader566, %.lr.ph479
  %127 = phi i64 [ %133, %.lr.ph479 ], [ %.ph567, %.lr.ph479.preheader566 ]
  %128 = phi i64 [ %129, %.lr.ph479 ], [ %.ph568, %.lr.ph479.preheader566 ]
  %129 = add nuw nsw i64 %128, 1
  %130 = getelementptr i32, ptr %106, i64 %128
  %131 = load i32, ptr %130, align 4, !tbaa !3
  %132 = getelementptr i32, ptr %118, i64 %128
  store i32 %131, ptr %132, align 4, !tbaa !3
  %133 = add nsw i64 %127, -1
  %134 = icmp ugt i64 %127, 1
  br i1 %134, label %.lr.ph479, label %.thread, !llvm.loop !17

.lr.ph480:                                        ; preds = %.lr.ph480.preheader564, %.lr.ph480
  %135 = phi i64 [ %141, %.lr.ph480 ], [ %.ph, %.lr.ph480.preheader564 ]
  %136 = phi i64 [ %137, %.lr.ph480 ], [ %.ph565, %.lr.ph480.preheader564 ]
  %137 = add nuw nsw i64 %136, 1
  %138 = getelementptr i32, ptr %106, i64 %136
  %139 = load i32, ptr %138, align 4, !tbaa !3
  %140 = getelementptr i32, ptr %22, i64 %136
  store i32 %139, ptr %140, align 4, !tbaa !3
  %141 = add nsw i64 %135, -1
  %142 = icmp ugt i64 %135, 1
  br i1 %142, label %.lr.ph480, label %._crit_edge481, !llvm.loop !18

.thread:                                          ; preds = %.lr.ph479, %middle.block508, %116
  call void @free(ptr %22)
  store ptr %118, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %101, ptr @_QFEb.8, align 8, !tbaa !7
  br label %._crit_edge481

._crit_edge481:                                   ; preds = %.lr.ph480, %middle.block, %.preheader, %.thread
  %143 = phi ptr [ %118, %.thread ], [ %22, %.preheader ], [ %22, %middle.block ], [ %22, %.lr.ph480 ]
  %144 = phi i64 [ %101, %.thread ], [ %21, %.preheader ], [ %21, %middle.block ], [ %21, %.lr.ph480 ]
  call void @free(ptr %106)
  call void @free(ptr %79)
  call void @free(ptr %50)
  br label %.loopexit

145:                                              ; preds = %36
  %146 = add nsw i32 %.0347472, -1
  %147 = add i32 %.0473, -1
  %148 = icmp sgt i32 %.0347472, 1
  %indvar.next525 = add i64 %indvar524, 1
  br i1 %148, label %.lr.ph, label %.loopexit

.loopexit:                                        ; preds = %145, %20, %._crit_edge481
  %149 = phi ptr [ %143, %._crit_edge481 ], [ %22, %20 ], [ %22, %145 ]
  %150 = phi i64 [ %144, %._crit_edge481 ], [ %21, %20 ], [ %21, %145 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %indvars498 = trunc i64 %indvars.iv.next to i32
  %151 = icmp sgt i32 %indvars498, 0
  %indvar.next = add i32 %indvar, 1
  br i1 %151, label %20, label %._crit_edge488

._crit_edge488:                                   ; preds = %.loopexit, %0
  %152 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.28693029, i64 4, ptr null, i32 -1, ptr nonnull @_QQcl.e2c5c6d09f6943a0f6b90f83267ca21a, i32 21)
  %.unpack385 = load ptr, ptr @_QFEans.0, align 8, !tbaa !7
  %.unpack392.unpack.unpack394 = load i64, ptr @_QFEans.8, align 8, !tbaa !7
  store ptr %.unpack385, ptr %1, align 8, !tbaa !7
  %.fca.1.gep128 = 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.gep128, align 8, !tbaa !7
  %.fca.2.gep130 = 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.gep130, align 8, !tbaa !7
  %.fca.3.gep132 = 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.gep132, align 4, !tbaa !7
  %.fca.4.gep134 = 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.gep134, align 1, !tbaa !7
  %.fca.5.gep136 = 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.gep136, align 2, !tbaa !7
  %.fca.6.gep138 = 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.gep138, align 1, !tbaa !7
  %.fca.7.0.0.gep140 = 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.gep140, align 8, !tbaa !7
  %.fca.7.0.1.gep142 = 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 %.unpack392.unpack.unpack394, ptr %.fca.7.0.1.gep142, align 8, !tbaa !7
  %.fca.7.0.2.gep144 = 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.gep144, align 8, !tbaa !7
  %153 = call i1 @_FortranAioOutputDescriptor(ptr %152, ptr nonnull %1)
  %154 = call i32 @_FortranAioEndIoStatement(ptr %152)
  ret void
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress 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) #3

declare i1 @_FortranAioOutputDescriptor(ptr, ptr) 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 i32 @llvm.smax.i32(i32, i32) #4

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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"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, !10}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
