program abc140c
  implicit none
  integer :: n
  integer,dimension(:),allocatable :: a, b, c
  read *, n
  n = n - 1
  allocate(c(n))
  read *, c
  a = [c(1),c]
  b = [c,c(n)]
  print *, sum(merge(a,b,a<b))
end program abc140c

; 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
@_QFEb.0 = internal unnamed_addr global ptr null
@_QFEb.8 = internal unnamed_addr global i64 0
@_QFEc.0 = internal unnamed_addr global ptr null
@_QFEc.8 = internal unnamed_addr global i64 0
@_QQcl.23bca2e055b9d9fab6717059b87e758a = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3306/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 i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.23bca2e055b9d9fab6717059b87e758a, i32 5)
  %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
  store i32 %7, ptr %2, 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 @_QFEc.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEc.8, align 8, !tbaa !7
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.23bca2e055b9d9fab6717059b87e758a, i32 8)
  %.unpack = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %.unpack436.unpack.unpack438 = load i64, ptr @_QFEc.8, align 8, !tbaa !7
  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 %.unpack436.unpack.unpack438, 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
  %13 = call i1 @_FortranAioInputDescriptor(ptr %12, ptr nonnull %1)
  %14 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %15 = call dereferenceable_or_null(128) ptr @malloc(i64 128)
  %.unpack441 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %16 = load i32, ptr %.unpack441, align 4, !tbaa !3
  store i32 %16, ptr %15, align 4, !tbaa !3
  %.unpack460.unpack.unpack462 = load i64, ptr @_QFEc.8, align 8, !tbaa !7
  %17 = shl i64 %.unpack460.unpack.unpack462, 2
  %18 = call ptr @malloc(i64 %17)
  %19 = icmp sgt i64 %.unpack460.unpack.unpack462, 0
  br i1 %19, label %._crit_edge, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  %20 = add nsw i64 %.unpack460.unpack.unpack462, 1
  br label %26

._crit_edge:                                      ; preds = %0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr nonnull align 4 %.unpack441, i64 %17, i1 false), !tbaa !3
  %21 = add nuw i64 %.unpack460.unpack.unpack462, 1
  %22 = icmp sgt i64 %21, 31
  br i1 %22, label %23, label %26

23:                                               ; preds = %._crit_edge
  %24 = shl i64 %21, 3
  %25 = call ptr @realloc(ptr nonnull %15, i64 %24)
  br label %26

26:                                               ; preds = %._crit_edge.thread, %23, %._crit_edge
  %27 = phi i64 [ %21, %23 ], [ %21, %._crit_edge ], [ %20, %._crit_edge.thread ]
  %28 = phi ptr [ %25, %23 ], [ %15, %._crit_edge ], [ %15, %._crit_edge.thread ]
  %29 = getelementptr i32, ptr %28, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %29, ptr align 1 %18, i64 %17, i1 false)
  %.unpack465 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.not = icmp eq ptr %.unpack465, null
  br i1 %.not, label %42, label %30

30:                                               ; preds = %26
  %.unpack472.unpack.unpack474 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %.not562 = icmp eq i64 %.unpack472.unpack.unpack474, %27
  br i1 %.not562, label %.preheader566, label %35

.preheader566:                                    ; preds = %30
  %31 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %31, label %.lr.ph570.preheader, label %._crit_edge571

.lr.ph570.preheader:                              ; preds = %.preheader566
  %32 = add nuw i64 %.unpack460.unpack.unpack462, 2
  %smin588 = call i64 @llvm.smin.i64(i64 %27, i64 1)
  %33 = sub i64 %32, %smin588
  %34 = shl nuw i64 %33, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %.unpack465, ptr align 4 %28, i64 %34, i1 false), !tbaa !3
  br label %._crit_edge571

35:                                               ; preds = %30
  %36 = shl i64 %27, 2
  %37 = call ptr @malloc(i64 %36)
  %38 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %38, label %.lr.ph569.preheader, label %.thread557

.lr.ph569.preheader:                              ; preds = %35
  %39 = add nuw i64 %.unpack460.unpack.unpack462, 2
  %smin = call i64 @llvm.smin.i64(i64 %27, i64 1)
  %40 = sub i64 %39, %smin
  %41 = shl nuw i64 %40, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %28, i64 %41, i1 false), !tbaa !3
  br label %.thread557

42:                                               ; preds = %26
  %43 = shl i64 %27, 2
  %44 = call ptr @malloc(i64 %43)
  %45 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %45, label %.lr.ph573.preheader, label %.loopexit565.thread

.lr.ph573.preheader:                              ; preds = %42
  %46 = add nuw i64 %.unpack460.unpack.unpack462, 2
  %smin589 = call i64 @llvm.smin.i64(i64 %27, i64 1)
  %47 = sub i64 %46, %smin589
  %48 = shl nuw i64 %47, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %28, i64 %48, i1 false), !tbaa !3
  br label %.loopexit565.thread

.thread557:                                       ; preds = %35, %.lr.ph569.preheader
  call void @free(ptr nonnull %.unpack465)
  br label %.loopexit565.thread

.loopexit565.thread:                              ; preds = %42, %.lr.ph573.preheader, %.thread557
  %.ph591 = phi ptr [ %37, %.thread557 ], [ %44, %.lr.ph573.preheader ], [ %44, %42 ]
  store ptr %.ph591, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %27, ptr @_QFEa.8, align 8, !tbaa !7
  br label %._crit_edge571

._crit_edge571:                                   ; preds = %.preheader566, %.lr.ph570.preheader, %.loopexit565.thread
  call void @free(ptr %28)
  call void @free(ptr %18)
  %49 = call dereferenceable_or_null(128) ptr @malloc(i64 128)
  %50 = call ptr @malloc(i64 %17)
  br i1 %19, label %._crit_edge576, label %._crit_edge576.thread

._crit_edge576:                                   ; preds = %._crit_edge571
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr nonnull align 4 %.unpack441, i64 %17, i1 false), !tbaa !3
  %51 = icmp ugt i64 %.unpack460.unpack.unpack462, 31
  br i1 %51, label %52, label %._crit_edge576.thread

52:                                               ; preds = %._crit_edge576
  %53 = shl nuw i64 %.unpack460.unpack.unpack462, 1
  %54 = shl i64 %.unpack460.unpack.unpack462, 3
  %55 = call ptr @realloc(ptr %49, i64 %54)
  br label %._crit_edge576.thread

._crit_edge576.thread:                            ; preds = %._crit_edge571, %52, %._crit_edge576
  %.0407 = phi i64 [ %53, %52 ], [ 32, %._crit_edge576 ], [ 32, %._crit_edge571 ]
  %56 = phi ptr [ %55, %52 ], [ %49, %._crit_edge576 ], [ %49, %._crit_edge571 ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %56, ptr align 1 %50, i64 %17, i1 false)
  %57 = load i32, ptr %2, align 4, !tbaa !3
  %58 = sext i32 %57 to i64
  %59 = add nsw i64 %58, -1
  %60 = getelementptr i32, ptr %.unpack441, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !3
  %.not501 = icmp sgt i64 %.0407, %27
  br i1 %.not501, label %65, label %62

62:                                               ; preds = %._crit_edge576.thread
  %63 = shl i64 %27, 3
  %64 = call ptr @realloc(ptr %56, i64 %63)
  br label %65

65:                                               ; preds = %62, %._crit_edge576.thread
  %66 = phi ptr [ %64, %62 ], [ %56, %._crit_edge576.thread ]
  %67 = ptrtoint ptr %66 to i64
  %68 = getelementptr i32, ptr %66, i64 %.unpack460.unpack.unpack462
  store i32 %61, ptr %68, align 4, !tbaa !3
  %.unpack502 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack502603 = ptrtoint ptr %.unpack502 to i64
  %.not514 = icmp eq ptr %.unpack502, null
  br i1 %.not514, label %106, label %69

69:                                               ; preds = %65
  %.unpack509.unpack.unpack511 = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  %.not563 = icmp eq i64 %.unpack509.unpack.unpack511, %27
  br i1 %.not563, label %.preheader, label %78

.preheader:                                       ; preds = %69
  %70 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %70, label %.lr.ph579.preheader, label %._crit_edge580

.lr.ph579.preheader:                              ; preds = %.preheader
  %71 = call i64 @llvm.smax.i64(i64 %27, i64 1)
  %min.iters.check608 = icmp ult i64 %71, 8
  %72 = sub i64 %.unpack502603, %67
  %diff.check604 = icmp ult i64 %72, 32
  %or.cond = select i1 %min.iters.check608, i1 true, i1 %diff.check604
  br i1 %or.cond, label %.lr.ph579.preheader679, label %vector.ph609

vector.ph609:                                     ; preds = %.lr.ph579.preheader
  %n.vec611 = and i64 %71, 9223372036854775800
  %ind.end612 = sub i64 %27, %n.vec611
  br label %vector.body616

vector.body616:                                   ; preds = %vector.body616, %vector.ph609
  %index617 = phi i64 [ 0, %vector.ph609 ], [ %index.next620, %vector.body616 ]
  %73 = getelementptr i32, ptr %66, i64 %index617
  %wide.load618 = load <4 x i32>, ptr %73, align 4, !tbaa !3
  %74 = getelementptr i32, ptr %73, i64 4
  %wide.load619 = load <4 x i32>, ptr %74, align 4, !tbaa !3
  %75 = getelementptr i32, ptr %.unpack502, i64 %index617
  store <4 x i32> %wide.load618, ptr %75, align 4, !tbaa !3
  %76 = getelementptr i32, ptr %75, i64 4
  store <4 x i32> %wide.load619, ptr %76, align 4, !tbaa !3
  %index.next620 = add nuw i64 %index617, 8
  %77 = icmp eq i64 %index.next620, %n.vec611
  br i1 %77, label %middle.block606, label %vector.body616, !llvm.loop !9

middle.block606:                                  ; preds = %vector.body616
  %cmp.n615 = icmp eq i64 %71, %n.vec611
  br i1 %cmp.n615, label %._crit_edge580, label %.lr.ph579.preheader679

.lr.ph579.preheader679:                           ; preds = %.lr.ph579.preheader, %middle.block606
  %.ph680 = phi i64 [ %27, %.lr.ph579.preheader ], [ %ind.end612, %middle.block606 ]
  %.ph681 = phi i64 [ 0, %.lr.ph579.preheader ], [ %n.vec611, %middle.block606 ]
  br label %.lr.ph579

78:                                               ; preds = %69
  %79 = shl i64 %27, 2
  %80 = call ptr @malloc(i64 %79)
  %81 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %81, label %.lr.ph578.preheader, label %.thread561

.lr.ph578.preheader:                              ; preds = %78
  %82 = ptrtoint ptr %80 to i64
  %83 = call i64 @llvm.smax.i64(i64 %27, i64 1)
  %min.iters.check = icmp ult i64 %83, 8
  %84 = sub i64 %82, %67
  %diff.check = icmp ult i64 %84, 32
  %or.cond668 = or i1 %min.iters.check, %diff.check
  br i1 %or.cond668, label %.lr.ph578.preheader682, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph578.preheader
  %n.vec = and i64 %83, 9223372036854775800
  %ind.end = sub i64 %27, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %85 = getelementptr i32, ptr %66, i64 %index
  %wide.load = load <4 x i32>, ptr %85, align 4, !tbaa !3
  %86 = getelementptr i32, ptr %85, i64 4
  %wide.load601 = load <4 x i32>, ptr %86, align 4, !tbaa !3
  %87 = getelementptr i32, ptr %80, i64 %index
  store <4 x i32> %wide.load, ptr %87, align 4, !tbaa !3
  %88 = getelementptr i32, ptr %87, i64 4
  store <4 x i32> %wide.load601, ptr %88, align 4, !tbaa !3
  %index.next = add nuw i64 %index, 8
  %89 = icmp eq i64 %index.next, %n.vec
  br i1 %89, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %83, %n.vec
  br i1 %cmp.n, label %.loopexit, label %.lr.ph578.preheader682

.lr.ph578.preheader682:                           ; preds = %.lr.ph578.preheader, %middle.block
  %.ph683 = phi i64 [ %27, %.lr.ph578.preheader ], [ %ind.end, %middle.block ]
  %.ph684 = phi i64 [ 0, %.lr.ph578.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph578

.lr.ph578:                                        ; preds = %.lr.ph578.preheader682, %.lr.ph578
  %90 = phi i64 [ %96, %.lr.ph578 ], [ %.ph683, %.lr.ph578.preheader682 ]
  %91 = phi i64 [ %92, %.lr.ph578 ], [ %.ph684, %.lr.ph578.preheader682 ]
  %92 = add nuw nsw i64 %91, 1
  %93 = getelementptr i32, ptr %66, i64 %91
  %94 = load i32, ptr %93, align 4, !tbaa !3
  %95 = getelementptr i32, ptr %80, i64 %91
  store i32 %94, ptr %95, align 4, !tbaa !3
  %96 = add nsw i64 %90, -1
  %97 = icmp sgt i64 %90, 1
  br i1 %97, label %.lr.ph578, label %.loopexit, !llvm.loop !13

.lr.ph579:                                        ; preds = %.lr.ph579.preheader679, %.lr.ph579
  %98 = phi i64 [ %104, %.lr.ph579 ], [ %.ph680, %.lr.ph579.preheader679 ]
  %99 = phi i64 [ %100, %.lr.ph579 ], [ %.ph681, %.lr.ph579.preheader679 ]
  %100 = add nuw nsw i64 %99, 1
  %101 = getelementptr i32, ptr %66, i64 %99
  %102 = load i32, ptr %101, align 4, !tbaa !3
  %103 = getelementptr i32, ptr %.unpack502, i64 %99
  store i32 %102, ptr %103, align 4, !tbaa !3
  %104 = add nsw i64 %98, -1
  %105 = icmp sgt i64 %98, 1
  br i1 %105, label %.lr.ph579, label %._crit_edge580, !llvm.loop !14

106:                                              ; preds = %65
  %107 = shl i64 %27, 2
  %108 = call ptr @malloc(i64 %107)
  %109 = icmp ult i64 %.unpack460.unpack.unpack462, 9223372036854775807
  br i1 %109, label %.lr.ph582.preheader, label %.loopexit.thread

.lr.ph582.preheader:                              ; preds = %106
  %110 = ptrtoint ptr %108 to i64
  %111 = call i64 @llvm.smax.i64(i64 %27, i64 1)
  %min.iters.check626 = icmp ult i64 %111, 8
  %112 = sub i64 %110, %67
  %diff.check622 = icmp ult i64 %112, 32
  %or.cond669 = or i1 %min.iters.check626, %diff.check622
  br i1 %or.cond669, label %.lr.ph582.preheader676, label %vector.ph627

vector.ph627:                                     ; preds = %.lr.ph582.preheader
  %n.vec629 = and i64 %111, 9223372036854775800
  %ind.end630 = sub i64 %27, %n.vec629
  br label %vector.body634

vector.body634:                                   ; preds = %vector.body634, %vector.ph627
  %index635 = phi i64 [ 0, %vector.ph627 ], [ %index.next638, %vector.body634 ]
  %113 = getelementptr i32, ptr %66, i64 %index635
  %wide.load636 = load <4 x i32>, ptr %113, align 4, !tbaa !3
  %114 = getelementptr i32, ptr %113, i64 4
  %wide.load637 = load <4 x i32>, ptr %114, align 4, !tbaa !3
  %115 = getelementptr i32, ptr %108, i64 %index635
  store <4 x i32> %wide.load636, ptr %115, align 4, !tbaa !3
  %116 = getelementptr i32, ptr %115, i64 4
  store <4 x i32> %wide.load637, ptr %116, align 4, !tbaa !3
  %index.next638 = add nuw i64 %index635, 8
  %117 = icmp eq i64 %index.next638, %n.vec629
  br i1 %117, label %middle.block624, label %vector.body634, !llvm.loop !15

middle.block624:                                  ; preds = %vector.body634
  %cmp.n633 = icmp eq i64 %111, %n.vec629
  br i1 %cmp.n633, label %.loopexit, label %.lr.ph582.preheader676

.lr.ph582.preheader676:                           ; preds = %.lr.ph582.preheader, %middle.block624
  %.ph677 = phi i64 [ %27, %.lr.ph582.preheader ], [ %ind.end630, %middle.block624 ]
  %.ph678 = phi i64 [ 0, %.lr.ph582.preheader ], [ %n.vec629, %middle.block624 ]
  br label %.lr.ph582

.lr.ph582:                                        ; preds = %.lr.ph582.preheader676, %.lr.ph582
  %118 = phi i64 [ %124, %.lr.ph582 ], [ %.ph677, %.lr.ph582.preheader676 ]
  %119 = phi i64 [ %120, %.lr.ph582 ], [ %.ph678, %.lr.ph582.preheader676 ]
  %120 = add nuw nsw i64 %119, 1
  %121 = getelementptr i32, ptr %66, i64 %119
  %122 = load i32, ptr %121, align 4, !tbaa !3
  %123 = getelementptr i32, ptr %108, i64 %119
  store i32 %122, ptr %123, align 4, !tbaa !3
  %124 = add nsw i64 %118, -1
  %125 = icmp sgt i64 %118, 1
  br i1 %125, label %.lr.ph582, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph578, %.lr.ph582, %middle.block, %middle.block624
  %.ph559 = phi ptr [ %108, %middle.block624 ], [ %80, %middle.block ], [ %108, %.lr.ph582 ], [ %80, %.lr.ph578 ]
  br i1 %.not514, label %.loopexit.thread, label %.thread561

.thread561:                                       ; preds = %78, %.loopexit
  %.ph559596 = phi ptr [ %.ph559, %.loopexit ], [ %80, %78 ]
  call void @free(ptr nonnull %.unpack502)
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %106, %.thread561, %.loopexit
  %.ph559593 = phi ptr [ %.ph559596, %.thread561 ], [ %.ph559, %.loopexit ], [ %108, %106 ]
  store ptr %.ph559593, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %27, ptr @_QFEb.8, align 8, !tbaa !7
  br label %._crit_edge580

._crit_edge580:                                   ; preds = %.lr.ph579, %middle.block606, %.preheader, %.loopexit.thread
  call void @free(ptr nonnull %66)
  call void @free(ptr %50)
  %126 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.23bca2e055b9d9fab6717059b87e758a, i32 11)
  %.unpack515 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack522.unpack.unpack524 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %.unpack527 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %127 = shl i64 %.unpack522.unpack.unpack524, 2
  %128 = call ptr @malloc(i64 %127)
  %129 = icmp sgt i64 %.unpack522.unpack.unpack524, 0
  br i1 %129, label %.lr.ph584.preheader, label %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph584.preheader:                              ; preds = %._crit_edge580
  %min.iters.check641 = icmp ult i64 %.unpack522.unpack.unpack524, 8
  br i1 %min.iters.check641, label %.lr.ph584.preheader674, label %vector.ph642

vector.ph642:                                     ; preds = %.lr.ph584.preheader
  %n.vec644 = and i64 %.unpack522.unpack.unpack524, -8
  br label %vector.body647

vector.body647:                                   ; preds = %vector.body647, %vector.ph642
  %index648 = phi i64 [ 0, %vector.ph642 ], [ %index.next653, %vector.body647 ]
  %130 = getelementptr i32, ptr %.unpack515, i64 %index648
  %wide.load649 = load <4 x i32>, ptr %130, align 4, !tbaa !3
  %131 = getelementptr i32, ptr %130, i64 4
  %wide.load650 = load <4 x i32>, ptr %131, align 4, !tbaa !3
  %132 = getelementptr i32, ptr %.unpack527, i64 %index648
  %wide.load651 = load <4 x i32>, ptr %132, align 4, !tbaa !3
  %133 = getelementptr i32, ptr %132, i64 4
  %wide.load652 = load <4 x i32>, ptr %133, align 4, !tbaa !3
  %134 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load649, <4 x i32> %wide.load651)
  %135 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load650, <4 x i32> %wide.load652)
  %136 = getelementptr i32, ptr %128, i64 %index648
  store <4 x i32> %134, ptr %136, align 4, !tbaa !3
  %137 = getelementptr i32, ptr %136, i64 4
  store <4 x i32> %135, ptr %137, align 4, !tbaa !3
  %index.next653 = add nuw i64 %index648, 8
  %138 = icmp eq i64 %index.next653, %n.vec644
  br i1 %138, label %middle.block639, label %vector.body647, !llvm.loop !17

middle.block639:                                  ; preds = %vector.body647
  %cmp.n646 = icmp eq i64 %.unpack522.unpack.unpack524, %n.vec644
  br i1 %cmp.n646, label %._crit_edge585, label %.lr.ph584.preheader674

.lr.ph584.preheader674:                           ; preds = %.lr.ph584.preheader, %middle.block639
  %.ph675 = phi i64 [ 0, %.lr.ph584.preheader ], [ %n.vec644, %middle.block639 ]
  br label %.lr.ph584

.lr.ph584:                                        ; preds = %.lr.ph584.preheader674, %.lr.ph584
  %139 = phi i64 [ %145, %.lr.ph584 ], [ %.ph675, %.lr.ph584.preheader674 ]
  %140 = getelementptr i32, ptr %.unpack515, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !3
  %142 = getelementptr i32, ptr %.unpack527, i64 %139
  %143 = load i32, ptr %142, align 4, !tbaa !3
  %144 = call i32 @llvm.smin.i32(i32 %141, i32 %143)
  %145 = add nuw nsw i64 %139, 1
  %146 = getelementptr i32, ptr %128, i64 %139
  store i32 %144, ptr %146, align 4, !tbaa !3
  %exitcond.not = icmp eq i64 %145, %.unpack522.unpack.unpack524
  br i1 %exitcond.not, label %._crit_edge585, label %.lr.ph584, !llvm.loop !18

._crit_edge585:                                   ; preds = %.lr.ph584, %middle.block639
  br i1 %129, label %.lr.ph.i.preheader, label %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %._crit_edge585
  %min.iters.check656 = icmp ult i64 %.unpack522.unpack.unpack524, 8
  br i1 %min.iters.check656, label %.lr.ph.i.preheader670, label %vector.ph657

vector.ph657:                                     ; preds = %.lr.ph.i.preheader
  %n.vec659 = and i64 %.unpack522.unpack.unpack524, -8
  br label %vector.body662

vector.body662:                                   ; preds = %vector.body662, %vector.ph657
  %index663 = phi i64 [ 0, %vector.ph657 ], [ %index.next667, %vector.body662 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph657 ], [ %150, %vector.body662 ]
  %vec.phi664 = phi <4 x i32> [ zeroinitializer, %vector.ph657 ], [ %151, %vector.body662 ]
  %147 = shl i64 %index663, 2
  %148 = getelementptr i8, ptr %128, i64 %147
  %wide.load665 = load <4 x i32>, ptr %148, align 4, !tbaa !3
  %149 = getelementptr i32, ptr %148, i64 4
  %wide.load666 = load <4 x i32>, ptr %149, align 4, !tbaa !3
  %150 = add <4 x i32> %wide.load665, %vec.phi
  %151 = add <4 x i32> %wide.load666, %vec.phi664
  %index.next667 = add nuw i64 %index663, 8
  %152 = icmp eq i64 %index.next667, %n.vec659
  br i1 %152, label %middle.block654, label %vector.body662, !llvm.loop !19

middle.block654:                                  ; preds = %vector.body662
  %bin.rdx = add <4 x i32> %151, %150
  %153 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n661 = icmp eq i64 %.unpack522.unpack.unpack524, %n.vec659
  br i1 %cmp.n661, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader670

.lr.ph.i.preheader670:                            ; preds = %.lr.ph.i.preheader, %middle.block654
  %.ph = phi i32 [ 0, %.lr.ph.i.preheader ], [ %153, %middle.block654 ]
  %.ph671 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec659, %middle.block654 ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader670, %.lr.ph.i
  %154 = phi i32 [ %159, %.lr.ph.i ], [ %.ph, %.lr.ph.i.preheader670 ]
  %155 = phi i64 [ %160, %.lr.ph.i ], [ %.ph671, %.lr.ph.i.preheader670 ]
  %156 = shl i64 %155, 2
  %157 = getelementptr i8, ptr %128, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !3
  %159 = add i32 %158, %154
  %160 = add nuw nsw i64 %155, 1
  %exitcond.not.i = icmp eq i64 %160, %.unpack522.unpack.unpack524
  br i1 %exitcond.not.i, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !20

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block654, %._crit_edge580, %._crit_edge585
  %.lcssa.i = phi i32 [ 0, %._crit_edge585 ], [ 0, %._crit_edge580 ], [ %153, %middle.block654 ], [ %159, %.lr.ph.i ]
  %161 = call i1 @_FortranAioOutputInteger32(ptr %126, i32 %.lcssa.i)
  call void @free(ptr %128)
  %162 = call i32 @_FortranAioEndIoStatement(ptr %126)
  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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #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) }
attributes #5 = { nocallback nofree nosync nounwind 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, !11, !10}
!19 = distinct !{!19, !10, !11}
!20 = distinct !{!20, !11, !10}
