program abc116c
  integer n
  integer, allocatable :: h(:), a(:)
  read *, n
  allocate(h(n), a(n + 1))
  read *, h
  a = [h, 0] - [0, h]
  print *, sum(a, a > 0)
end program abc116c

; 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
@_QFEh.0 = internal unnamed_addr global ptr null
@_QFEh.8 = internal unnamed_addr global i64 0
@_QQcl.6d5940e1b0c8c1fd4c0815a34eb2df05 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5074/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; 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 { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca i32, align 4
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d5940e1b0c8c1fd4c0815a34eb2df05, i32 4)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %8 = load i32, ptr %4, 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 @_QFEh.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEh.8, align 8, !tbaa !7
  %13 = add i32 %8, 1
  %14 = call i32 @llvm.smax.i32(i32 %13, i32 0)
  %15 = zext i32 %14 to i64
  %16 = shl nuw nsw i64 %15, 2
  %17 = call ptr @malloc(i64 %16)
  store ptr %17, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %15, ptr @_QFEa.8, align 8, !tbaa !7
  %18 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.6d5940e1b0c8c1fd4c0815a34eb2df05, i32 6)
  %.unpack = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack330.unpack.unpack332 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %3, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, 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 %3, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack330.unpack.unpack332, 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 %3, i64 0, i32 7, i64 0, i64 2
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %19 = call i1 @_FortranAioInputDescriptor(ptr %18, ptr nonnull %3)
  %20 = call i32 @_FortranAioEndIoStatement(ptr %18)
  %21 = call dereferenceable_or_null(128) ptr @malloc(i64 128)
  %.unpack335 = load ptr, ptr @_QFEh.0, align 8, !tbaa !7
  %.unpack342.unpack.unpack344 = load i64, ptr @_QFEh.8, align 8, !tbaa !7
  %22 = shl i64 %.unpack342.unpack.unpack344, 2
  %23 = call ptr @malloc(i64 %22)
  %24 = icmp sgt i64 %.unpack342.unpack.unpack344, 0
  br i1 %24, label %._crit_edge, label %._crit_edge.thread

._crit_edge:                                      ; preds = %0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %.unpack335, i64 %22, i1 false), !tbaa !3
  %25 = icmp ugt i64 %.unpack342.unpack.unpack344, 31
  br i1 %25, label %26, label %._crit_edge.thread

26:                                               ; preds = %._crit_edge
  %27 = shl nuw i64 %.unpack342.unpack.unpack344, 1
  %28 = shl i64 %.unpack342.unpack.unpack344, 3
  %29 = call ptr @realloc(ptr %21, i64 %28)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0, %26, %._crit_edge
  %.0 = phi i64 [ %27, %26 ], [ 32, %._crit_edge ], [ 32, %0 ]
  %30 = phi ptr [ %29, %26 ], [ %21, %._crit_edge ], [ %21, %0 ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %30, ptr align 1 %23, i64 %22, i1 false)
  %31 = add i64 %.unpack342.unpack.unpack344, 1
  %.not = icmp sgt i64 %.0, %31
  br i1 %.not, label %35, label %32

32:                                               ; preds = %._crit_edge.thread
  %33 = shl i64 %31, 3
  %34 = call ptr @realloc(ptr %30, i64 %33)
  br label %35

35:                                               ; preds = %32, %._crit_edge.thread
  %36 = phi ptr [ %34, %32 ], [ %30, %._crit_edge.thread ]
  %37 = ptrtoint ptr %36 to i64
  %38 = getelementptr i32, ptr %36, i64 %.unpack342.unpack.unpack344
  store i32 0, ptr %38, align 4, !tbaa !3
  %39 = call dereferenceable_or_null(128) ptr @malloc(i64 128)
  store i32 0, ptr %39, align 4, !tbaa !3
  %40 = call ptr @malloc(i64 %22)
  br i1 %24, label %._crit_edge398, label %._crit_edge398.thread

._crit_edge398:                                   ; preds = %35
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %.unpack335, i64 %22, i1 false), !tbaa !3
  %41 = icmp sgt i64 %31, 31
  br i1 %41, label %42, label %._crit_edge398.thread

42:                                               ; preds = %._crit_edge398
  %43 = shl i64 %31, 3
  %44 = call ptr @realloc(ptr nonnull %39, i64 %43)
  br label %._crit_edge398.thread

._crit_edge398.thread:                            ; preds = %35, %42, %._crit_edge398
  %45 = phi ptr [ %44, %42 ], [ %39, %._crit_edge398 ], [ %39, %35 ]
  %46 = ptrtoint ptr %45 to i64
  %47 = getelementptr i32, ptr %45, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %47, ptr align 1 %40, i64 %22, i1 false)
  %.unpack359 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack359422 = ptrtoint ptr %.unpack359 to i64
  %.not371 = icmp eq ptr %.unpack359, null
  br i1 %.not371, label %105, label %48

48:                                               ; preds = %._crit_edge398.thread
  %.unpack366.unpack.unpack368 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %.not394 = icmp eq i64 %.unpack366.unpack.unpack368, %31
  br i1 %.not394, label %.preheader, label %64

.preheader:                                       ; preds = %48
  %49 = icmp ult i64 %.unpack342.unpack.unpack344, 9223372036854775807
  br i1 %49, label %.lr.ph401.preheader, label %._crit_edge402

.lr.ph401.preheader:                              ; preds = %.preheader
  %50 = add i64 %.unpack342.unpack.unpack344, 2
  %51 = icmp ne i64 %31, 0
  %umin426.neg = sext i1 %51 to i64
  %52 = add i64 %50, %umin426.neg
  %min.iters.check429 = icmp ult i64 %52, 8
  br i1 %min.iters.check429, label %.lr.ph401.preheader487, label %vector.memcheck421

vector.memcheck421:                               ; preds = %.lr.ph401.preheader
  %53 = sub i64 %.unpack359422, %37
  %diff.check423 = icmp ult i64 %53, 32
  %54 = sub i64 %.unpack359422, %46
  %diff.check424 = icmp ult i64 %54, 32
  %conflict.rdx425 = or i1 %diff.check423, %diff.check424
  br i1 %conflict.rdx425, label %.lr.ph401.preheader487, label %vector.ph430

vector.ph430:                                     ; preds = %vector.memcheck421
  %n.vec432 = and i64 %52, -8
  %ind.end433 = sub i64 %31, %n.vec432
  br label %vector.body437

vector.body437:                                   ; preds = %vector.body437, %vector.ph430
  %index438 = phi i64 [ 0, %vector.ph430 ], [ %index.next443, %vector.body437 ]
  %55 = getelementptr i32, ptr %36, i64 %index438
  %wide.load439 = load <4 x i32>, ptr %55, align 4, !tbaa !3
  %56 = getelementptr i32, ptr %55, i64 4
  %wide.load440 = load <4 x i32>, ptr %56, align 4, !tbaa !3
  %57 = getelementptr i32, ptr %45, i64 %index438
  %wide.load441 = load <4 x i32>, ptr %57, align 4, !tbaa !3
  %58 = getelementptr i32, ptr %57, i64 4
  %wide.load442 = load <4 x i32>, ptr %58, align 4, !tbaa !3
  %59 = sub <4 x i32> %wide.load439, %wide.load441
  %60 = sub <4 x i32> %wide.load440, %wide.load442
  %61 = getelementptr i32, ptr %.unpack359, i64 %index438
  store <4 x i32> %59, ptr %61, align 4, !tbaa !3
  %62 = getelementptr i32, ptr %61, i64 4
  store <4 x i32> %60, ptr %62, align 4, !tbaa !3
  %index.next443 = add nuw i64 %index438, 8
  %63 = icmp eq i64 %index.next443, %n.vec432
  br i1 %63, label %middle.block427, label %vector.body437, !llvm.loop !9

middle.block427:                                  ; preds = %vector.body437
  %cmp.n436 = icmp eq i64 %52, %n.vec432
  br i1 %cmp.n436, label %._crit_edge402, label %.lr.ph401.preheader487

.lr.ph401.preheader487:                           ; preds = %vector.memcheck421, %.lr.ph401.preheader, %middle.block427
  %.ph488 = phi i64 [ %31, %vector.memcheck421 ], [ %31, %.lr.ph401.preheader ], [ %ind.end433, %middle.block427 ]
  %.ph489 = phi i64 [ 0, %vector.memcheck421 ], [ 0, %.lr.ph401.preheader ], [ %n.vec432, %middle.block427 ]
  br label %.lr.ph401

64:                                               ; preds = %48
  %65 = shl i64 %31, 2
  %66 = call ptr @malloc(i64 %65)
  %67 = ptrtoint ptr %66 to i64
  %68 = icmp ult i64 %.unpack342.unpack.unpack344, 9223372036854775807
  br i1 %68, label %.lr.ph400.preheader, label %.thread393

.lr.ph400.preheader:                              ; preds = %64
  %69 = add i64 %.unpack342.unpack.unpack344, 2
  %70 = icmp ne i64 %31, 0
  %umin.neg = sext i1 %70 to i64
  %71 = add i64 %69, %umin.neg
  %min.iters.check = icmp ult i64 %71, 8
  br i1 %min.iters.check, label %.lr.ph400.preheader490, label %vector.memcheck

vector.memcheck:                                  ; preds = %.lr.ph400.preheader
  %72 = sub i64 %67, %37
  %diff.check = icmp ult i64 %72, 32
  %73 = sub i64 %67, %46
  %diff.check416 = icmp ult i64 %73, 32
  %conflict.rdx = or i1 %diff.check, %diff.check416
  br i1 %conflict.rdx, label %.lr.ph400.preheader490, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %71, -8
  %ind.end = sub i64 %31, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %74 = getelementptr i32, ptr %36, i64 %index
  %wide.load = load <4 x i32>, ptr %74, align 4, !tbaa !3
  %75 = getelementptr i32, ptr %74, i64 4
  %wide.load418 = load <4 x i32>, ptr %75, align 4, !tbaa !3
  %76 = getelementptr i32, ptr %45, i64 %index
  %wide.load419 = load <4 x i32>, ptr %76, align 4, !tbaa !3
  %77 = getelementptr i32, ptr %76, i64 4
  %wide.load420 = load <4 x i32>, ptr %77, align 4, !tbaa !3
  %78 = sub <4 x i32> %wide.load, %wide.load419
  %79 = sub <4 x i32> %wide.load418, %wide.load420
  %80 = getelementptr i32, ptr %66, i64 %index
  store <4 x i32> %78, ptr %80, align 4, !tbaa !3
  %81 = getelementptr i32, ptr %80, i64 4
  store <4 x i32> %79, ptr %81, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %82 = icmp eq i64 %index.next, %n.vec
  br i1 %82, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %71, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph400.preheader490

.lr.ph400.preheader490:                           ; preds = %vector.memcheck, %.lr.ph400.preheader, %middle.block
  %.ph491 = phi i64 [ %31, %vector.memcheck ], [ %31, %.lr.ph400.preheader ], [ %ind.end, %middle.block ]
  %.ph492 = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph400.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph400

.lr.ph400:                                        ; preds = %.lr.ph400.preheader490, %.lr.ph400
  %83 = phi i64 [ %92, %.lr.ph400 ], [ %.ph491, %.lr.ph400.preheader490 ]
  %84 = phi i64 [ %85, %.lr.ph400 ], [ %.ph492, %.lr.ph400.preheader490 ]
  %85 = add nuw nsw i64 %84, 1
  %86 = getelementptr i32, ptr %36, i64 %84
  %87 = load i32, ptr %86, align 4, !tbaa !3
  %88 = getelementptr i32, ptr %45, i64 %84
  %89 = load i32, ptr %88, align 4, !tbaa !3
  %90 = sub i32 %87, %89
  %91 = getelementptr i32, ptr %66, i64 %84
  store i32 %90, ptr %91, align 4, !tbaa !3
  %92 = add nsw i64 %83, -1
  %93 = icmp ugt i64 %83, 1
  br i1 %93, label %.lr.ph400, label %.loopexit, !llvm.loop !13

.lr.ph401:                                        ; preds = %.lr.ph401.preheader487, %.lr.ph401
  %94 = phi i64 [ %103, %.lr.ph401 ], [ %.ph488, %.lr.ph401.preheader487 ]
  %95 = phi i64 [ %96, %.lr.ph401 ], [ %.ph489, %.lr.ph401.preheader487 ]
  %96 = add nuw nsw i64 %95, 1
  %97 = getelementptr i32, ptr %36, i64 %95
  %98 = load i32, ptr %97, align 4, !tbaa !3
  %99 = getelementptr i32, ptr %45, i64 %95
  %100 = load i32, ptr %99, align 4, !tbaa !3
  %101 = sub i32 %98, %100
  %102 = getelementptr i32, ptr %.unpack359, i64 %95
  store i32 %101, ptr %102, align 4, !tbaa !3
  %103 = add nsw i64 %94, -1
  %104 = icmp ugt i64 %94, 1
  br i1 %104, label %.lr.ph401, label %._crit_edge402, !llvm.loop !14

105:                                              ; preds = %._crit_edge398.thread
  %106 = shl i64 %31, 2
  %107 = call ptr @malloc(i64 %106)
  %108 = ptrtoint ptr %107 to i64
  %109 = icmp ult i64 %.unpack342.unpack.unpack344, 9223372036854775807
  br i1 %109, label %.lr.ph404.preheader, label %.loopexit.thread

.lr.ph404.preheader:                              ; preds = %105
  %110 = add i64 %.unpack342.unpack.unpack344, 2
  %111 = icmp ne i64 %31, 0
  %umin448.neg = sext i1 %111 to i64
  %112 = add i64 %110, %umin448.neg
  %min.iters.check451 = icmp ult i64 %112, 8
  br i1 %min.iters.check451, label %.lr.ph404.preheader484, label %vector.memcheck444

vector.memcheck444:                               ; preds = %.lr.ph404.preheader
  %113 = sub i64 %108, %37
  %diff.check445 = icmp ult i64 %113, 32
  %114 = sub i64 %108, %46
  %diff.check446 = icmp ult i64 %114, 32
  %conflict.rdx447 = or i1 %diff.check445, %diff.check446
  br i1 %conflict.rdx447, label %.lr.ph404.preheader484, label %vector.ph452

vector.ph452:                                     ; preds = %vector.memcheck444
  %n.vec454 = and i64 %112, -8
  %ind.end455 = sub i64 %31, %n.vec454
  br label %vector.body459

vector.body459:                                   ; preds = %vector.body459, %vector.ph452
  %index460 = phi i64 [ 0, %vector.ph452 ], [ %index.next465, %vector.body459 ]
  %115 = getelementptr i32, ptr %36, i64 %index460
  %wide.load461 = load <4 x i32>, ptr %115, align 4, !tbaa !3
  %116 = getelementptr i32, ptr %115, i64 4
  %wide.load462 = load <4 x i32>, ptr %116, align 4, !tbaa !3
  %117 = getelementptr i32, ptr %45, i64 %index460
  %wide.load463 = load <4 x i32>, ptr %117, align 4, !tbaa !3
  %118 = getelementptr i32, ptr %117, i64 4
  %wide.load464 = load <4 x i32>, ptr %118, align 4, !tbaa !3
  %119 = sub <4 x i32> %wide.load461, %wide.load463
  %120 = sub <4 x i32> %wide.load462, %wide.load464
  %121 = getelementptr i32, ptr %107, i64 %index460
  store <4 x i32> %119, ptr %121, align 4, !tbaa !3
  %122 = getelementptr i32, ptr %121, i64 4
  store <4 x i32> %120, ptr %122, align 4, !tbaa !3
  %index.next465 = add nuw i64 %index460, 8
  %123 = icmp eq i64 %index.next465, %n.vec454
  br i1 %123, label %middle.block449, label %vector.body459, !llvm.loop !15

middle.block449:                                  ; preds = %vector.body459
  %cmp.n458 = icmp eq i64 %112, %n.vec454
  br i1 %cmp.n458, label %.loopexit, label %.lr.ph404.preheader484

.lr.ph404.preheader484:                           ; preds = %vector.memcheck444, %.lr.ph404.preheader, %middle.block449
  %.ph485 = phi i64 [ %31, %vector.memcheck444 ], [ %31, %.lr.ph404.preheader ], [ %ind.end455, %middle.block449 ]
  %.ph486 = phi i64 [ 0, %vector.memcheck444 ], [ 0, %.lr.ph404.preheader ], [ %n.vec454, %middle.block449 ]
  br label %.lr.ph404

.lr.ph404:                                        ; preds = %.lr.ph404.preheader484, %.lr.ph404
  %124 = phi i64 [ %133, %.lr.ph404 ], [ %.ph485, %.lr.ph404.preheader484 ]
  %125 = phi i64 [ %126, %.lr.ph404 ], [ %.ph486, %.lr.ph404.preheader484 ]
  %126 = add nuw nsw i64 %125, 1
  %127 = getelementptr i32, ptr %36, i64 %125
  %128 = load i32, ptr %127, align 4, !tbaa !3
  %129 = getelementptr i32, ptr %45, i64 %125
  %130 = load i32, ptr %129, align 4, !tbaa !3
  %131 = sub i32 %128, %130
  %132 = getelementptr i32, ptr %107, i64 %125
  store i32 %131, ptr %132, align 4, !tbaa !3
  %133 = add nsw i64 %124, -1
  %134 = icmp ugt i64 %124, 1
  br i1 %134, label %.lr.ph404, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph400, %.lr.ph404, %middle.block, %middle.block449
  %.ph = phi ptr [ %107, %middle.block449 ], [ %66, %middle.block ], [ %107, %.lr.ph404 ], [ %66, %.lr.ph400 ]
  br i1 %.not371, label %.loopexit.thread, label %.thread393

.thread393:                                       ; preds = %64, %.loopexit
  %.ph413 = phi ptr [ %.ph, %.loopexit ], [ %66, %64 ]
  call void @free(ptr nonnull %.unpack359)
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %105, %.thread393, %.loopexit
  %.ph410 = phi ptr [ %.ph413, %.thread393 ], [ %.ph, %.loopexit ], [ %107, %105 ]
  store ptr %.ph410, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %31, ptr @_QFEa.8, align 8, !tbaa !7
  br label %._crit_edge402

._crit_edge402:                                   ; preds = %.lr.ph401, %middle.block427, %.preheader, %.loopexit.thread
  call void @free(ptr %45)
  call void @free(ptr %40)
  call void @free(ptr nonnull %36)
  call void @free(ptr %23)
  %135 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.6d5940e1b0c8c1fd4c0815a34eb2df05, i32 8)
  %.unpack372 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack379.unpack.unpack381 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  store ptr %.unpack372, ptr %2, align 8, !tbaa !7
  %.fca.1.gep210 = 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.gep210, align 8, !tbaa !7
  %.fca.2.gep212 = 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.gep212, align 8, !tbaa !7
  %.fca.3.gep214 = 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.gep214, align 4, !tbaa !7
  %.fca.4.gep216 = 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.gep216, align 1, !tbaa !7
  %.fca.5.gep218 = 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.gep218, align 2, !tbaa !7
  %.fca.6.gep220 = 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.gep220, align 1, !tbaa !7
  %.fca.7.0.0.gep222 = 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.gep222, align 8, !tbaa !7
  %.fca.7.0.1.gep224 = 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 %.unpack379.unpack.unpack381, ptr %.fca.7.0.1.gep224, align 8, !tbaa !7
  %.fca.7.0.2.gep226 = 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.gep226, align 8, !tbaa !7
  %136 = shl i64 %.unpack379.unpack.unpack381, 2
  %137 = call ptr @malloc(i64 %136)
  %138 = icmp sgt i64 %.unpack379.unpack.unpack381, 0
  br i1 %138, label %.lr.ph406.preheader, label %._crit_edge407

.lr.ph406.preheader:                              ; preds = %._crit_edge402
  %139 = ptrtoint ptr %137 to i64
  %.unpack372467 = ptrtoint ptr %.unpack372 to i64
  %min.iters.check471 = icmp ult i64 %.unpack379.unpack.unpack381, 8
  %140 = sub i64 %139, %.unpack372467
  %diff.check468 = icmp ult i64 %140, 32
  %or.cond = select i1 %min.iters.check471, i1 true, i1 %diff.check468
  br i1 %or.cond, label %.lr.ph406.preheader482, label %vector.ph472

vector.ph472:                                     ; preds = %.lr.ph406.preheader
  %n.vec474 = and i64 %.unpack379.unpack.unpack381, -8
  br label %vector.body477

vector.body477:                                   ; preds = %vector.body477, %vector.ph472
  %index478 = phi i64 [ 0, %vector.ph472 ], [ %index.next481, %vector.body477 ]
  %141 = getelementptr i32, ptr %.unpack372, i64 %index478
  %wide.load479 = load <4 x i32>, ptr %141, align 4, !tbaa !3
  %142 = getelementptr i32, ptr %141, i64 4
  %wide.load480 = load <4 x i32>, ptr %142, align 4, !tbaa !3
  %143 = icmp sgt <4 x i32> %wide.load479, zeroinitializer
  %144 = icmp sgt <4 x i32> %wide.load480, zeroinitializer
  %145 = zext <4 x i1> %143 to <4 x i32>
  %146 = zext <4 x i1> %144 to <4 x i32>
  %147 = getelementptr i32, ptr %137, i64 %index478
  store <4 x i32> %145, ptr %147, align 4, !tbaa !3
  %148 = getelementptr i32, ptr %147, i64 4
  store <4 x i32> %146, ptr %148, align 4, !tbaa !3
  %index.next481 = add nuw i64 %index478, 8
  %149 = icmp eq i64 %index.next481, %n.vec474
  br i1 %149, label %middle.block469, label %vector.body477, !llvm.loop !17

middle.block469:                                  ; preds = %vector.body477
  %cmp.n476 = icmp eq i64 %.unpack379.unpack.unpack381, %n.vec474
  br i1 %cmp.n476, label %._crit_edge407, label %.lr.ph406.preheader482

.lr.ph406.preheader482:                           ; preds = %.lr.ph406.preheader, %middle.block469
  %.ph483 = phi i64 [ 0, %.lr.ph406.preheader ], [ %n.vec474, %middle.block469 ]
  %150 = xor i64 %.ph483, -1
  %151 = add i64 %.unpack379.unpack.unpack381, %150
  %xtraiter = and i64 %.unpack379.unpack.unpack381, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph406.prol.loopexit, label %.lr.ph406.prol

.lr.ph406.prol:                                   ; preds = %.lr.ph406.preheader482, %.lr.ph406.prol
  %152 = phi i64 [ %157, %.lr.ph406.prol ], [ %.ph483, %.lr.ph406.preheader482 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph406.prol ], [ 0, %.lr.ph406.preheader482 ]
  %153 = getelementptr i32, ptr %.unpack372, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !3
  %155 = icmp sgt i32 %154, 0
  %156 = zext i1 %155 to i32
  %157 = add nuw nsw i64 %152, 1
  %158 = getelementptr i32, ptr %137, i64 %152
  store i32 %156, ptr %158, align 4, !tbaa !3
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph406.prol.loopexit, label %.lr.ph406.prol, !llvm.loop !18

.lr.ph406.prol.loopexit:                          ; preds = %.lr.ph406.prol, %.lr.ph406.preheader482
  %.unr = phi i64 [ %.ph483, %.lr.ph406.preheader482 ], [ %157, %.lr.ph406.prol ]
  %159 = icmp ult i64 %151, 3
  br i1 %159, label %._crit_edge407, label %.lr.ph406

.lr.ph406:                                        ; preds = %.lr.ph406.prol.loopexit, %.lr.ph406
  %160 = phi i64 [ %183, %.lr.ph406 ], [ %.unr, %.lr.ph406.prol.loopexit ]
  %161 = getelementptr i32, ptr %.unpack372, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !3
  %163 = icmp sgt i32 %162, 0
  %164 = zext i1 %163 to i32
  %165 = add nuw nsw i64 %160, 1
  %166 = getelementptr i32, ptr %137, i64 %160
  store i32 %164, ptr %166, align 4, !tbaa !3
  %167 = getelementptr i32, ptr %.unpack372, i64 %165
  %168 = load i32, ptr %167, align 4, !tbaa !3
  %169 = icmp sgt i32 %168, 0
  %170 = zext i1 %169 to i32
  %171 = add nuw nsw i64 %160, 2
  %172 = getelementptr i32, ptr %137, i64 %165
  store i32 %170, ptr %172, align 4, !tbaa !3
  %173 = getelementptr i32, ptr %.unpack372, i64 %171
  %174 = load i32, ptr %173, align 4, !tbaa !3
  %175 = icmp sgt i32 %174, 0
  %176 = zext i1 %175 to i32
  %177 = add nuw nsw i64 %160, 3
  %178 = getelementptr i32, ptr %137, i64 %171
  store i32 %176, ptr %178, align 4, !tbaa !3
  %179 = getelementptr i32, ptr %.unpack372, i64 %177
  %180 = load i32, ptr %179, align 4, !tbaa !3
  %181 = icmp sgt i32 %180, 0
  %182 = zext i1 %181 to i32
  %183 = add nuw nsw i64 %160, 4
  %184 = getelementptr i32, ptr %137, i64 %177
  store i32 %182, ptr %184, align 4, !tbaa !3
  %exitcond.not.3 = icmp eq i64 %183, %.unpack379.unpack.unpack381
  br i1 %exitcond.not.3, label %._crit_edge407, label %.lr.ph406, !llvm.loop !20

._crit_edge407:                                   ; preds = %.lr.ph406.prol.loopexit, %.lr.ph406, %middle.block469, %._crit_edge402
  store ptr %137, ptr %1, align 8, !tbaa !7
  %.fca.1.gep230 = 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.gep230, align 8, !tbaa !7
  %.fca.2.gep232 = 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.gep232, align 8, !tbaa !7
  %.fca.3.gep234 = 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.gep234, align 4, !tbaa !7
  %.fca.4.gep236 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 14, ptr %.fca.4.gep236, align 1, !tbaa !7
  %.fca.5.gep238 = 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.gep238, align 2, !tbaa !7
  %.fca.6.gep240 = 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.gep240, align 1, !tbaa !7
  %.fca.7.0.0.gep242 = 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.gep242, align 8, !tbaa !7
  %.fca.7.0.1.gep244 = 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 %.unpack379.unpack.unpack381, ptr %.fca.7.0.1.gep244, align 8, !tbaa !7
  %.fca.7.0.2.gep246 = 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.gep246, align 8, !tbaa !7
  %185 = call i32 @_FortranASumInteger4(ptr nonnull %2, ptr nonnull @_QQcl.6d5940e1b0c8c1fd4c0815a34eb2df05, i32 8, i32 0, ptr nonnull %1)
  %186 = call i1 @_FortranAioOutputInteger32(ptr %135, i32 %185)
  call void @free(ptr %137)
  %187 = call i32 @_FortranAioEndIoStatement(ptr %135)
  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

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

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

; 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, !11}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !10}
