program main
  implicit none
  integer :: n, i, ts, ptr, cnt
  integer, allocatable :: t(:), v(:), dp1(:), dp2(:), v2(:), v3(:)
  read *, n
  allocate (t(n), v(n))
  read *, t
  read *, v
  ts = sum(t)
  allocate (v2(0:ts), v3(1:ts), dp1(0:ts), dp2(0:ts))

  ! 各時刻の最高制限速度
  v2 = 10 ** 9
  v2(0) = 0
  v2(ts) = 0
  ptr = 0
  do i = 1, n
    v2(ptr:ptr + t(i)) = min(v2(ptr:ptr + t(i)), v(i))
    ptr = ptr + t(i)
  end do

  ! 各half-時刻の最高制限速度 v3(i) は i-0.5の最高速度 (i = 1, ..., ts)
  ptr = 0
  do i = 1, n
    v3(ptr + 1:ptr + t(i)) = v(i)
    ptr = ptr + t(i)
  end do

  ! 加速制約による最高速度
  dp1(0) = 0
  do i = 1, ts
    dp1(i) = min(dp1(i - 1) + 1, v2(i))
  end do

  ! 減速制約による最高速度
  dp2(ts) = 0
  do i = ts - 1, 0, -1
    dp2(i) = min(dp2(i + 1) + 1, v2(i))
  end do

  dp1 = min(dp1, dp2)

  ! 三角屋根補正
  cnt = 0
  do i = 1, ts  ! i-0.5を扱う
    if (dp1(i - 1) == dp1(i) .and. dp1(i) < v3(i)) then
      cnt = cnt + 1
    end if
  end do

  print "(f0.6)", sum(dp1) + 0.25d0 * cnt
end program main

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

@_QFEdp1.0 = internal unnamed_addr global ptr null
@_QFEdp1.7 = internal unnamed_addr global i64 1
@_QFEdp1.8 = internal unnamed_addr global i64 0
@_QFEdp2.0 = internal unnamed_addr global ptr null
@_QFEdp2.7 = internal unnamed_addr global i64 1
@_QFEt.0 = internal unnamed_addr global ptr null
@_QFEt.8 = internal unnamed_addr global i64 0
@_QFEv.0 = internal unnamed_addr global ptr null
@_QFEv.8 = internal unnamed_addr global i64 0
@_QFEv2.0 = internal unnamed_addr global ptr null
@_QFEv2.7 = internal unnamed_addr global i64 1
@_QFEv3.0 = internal unnamed_addr global ptr null
@_QQcl.ebf34b8ca5385f9c746e87dc5856649e = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6791/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"
@_QQcl.2866302E3629 = linkonce constant [6 x i8] c"(f0.6)"
@_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.ebf34b8ca5385f9c746e87dc5856649e, i32 5)
  %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 @_QFEt.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEt.8, align 8, !tbaa !7
  %12 = call ptr @malloc(i64 %10)
  store ptr %12, ptr @_QFEv.0, align 8, !tbaa !7
  store i64 %9, ptr @_QFEv.8, align 8, !tbaa !7
  %13 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ebf34b8ca5385f9c746e87dc5856649e, i32 7)
  %.unpack = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %.unpack1252.unpack.unpack1254 = load i64, ptr @_QFEt.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 %.unpack1252.unpack.unpack1254, 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 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ebf34b8ca5385f9c746e87dc5856649e, i32 8)
  %.unpack1257 = load ptr, ptr @_QFEv.0, align 8, !tbaa !7
  %.unpack1264.unpack.unpack1266 = load i64, ptr @_QFEv.8, align 8, !tbaa !7
  store ptr %.unpack1257, ptr %1, align 8, !tbaa !7
  %.fca.1.gep137 = 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.gep137, align 8, !tbaa !7
  %.fca.2.gep139 = 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.gep139, align 8, !tbaa !7
  %.fca.3.gep141 = 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.gep141, align 4, !tbaa !7
  %.fca.4.gep143 = 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.gep143, align 1, !tbaa !7
  %.fca.5.gep145 = 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.gep145, align 2, !tbaa !7
  %.fca.6.gep147 = 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.gep147, align 1, !tbaa !7
  %.fca.7.0.0.gep149 = 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.gep149, align 8, !tbaa !7
  %.fca.7.0.1.gep151 = 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 %.unpack1264.unpack.unpack1266, ptr %.fca.7.0.1.gep151, align 8, !tbaa !7
  %.fca.7.0.2.gep153 = 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.gep153, align 8, !tbaa !7
  %17 = call i1 @_FortranAioInputDescriptor(ptr %16, ptr nonnull %1)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %16)
  %.unpack1269 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %.unpack1276.unpack.unpack1278 = load i64, ptr @_QFEt.8, align 8, !tbaa !7
  %19 = icmp sgt i64 %.unpack1276.unpack.unpack1278, 0
  br i1 %19, label %.lr.ph.i.preheader, label %_FortranASumInteger4x1_contract_simplified.exit

.lr.ph.i.preheader:                               ; preds = %0
  %min.iters.check = icmp ult i64 %.unpack1276.unpack.unpack1278, 8
  br i1 %min.iters.check, label %.lr.ph.i.preheader1853, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.i.preheader
  %n.vec = and i64 %.unpack1276.unpack.unpack1278, -8
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
  %vec.phi1692 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
  %20 = shl i64 %index, 2
  %21 = getelementptr i8, ptr %.unpack1269, i64 %20
  %wide.load = load <4 x i32>, ptr %21, align 4, !tbaa !3
  %22 = getelementptr i32, ptr %21, i64 4
  %wide.load1693 = load <4 x i32>, ptr %22, align 4, !tbaa !3
  %23 = add <4 x i32> %wide.load, %vec.phi
  %24 = add <4 x i32> %wide.load1693, %vec.phi1692
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %24, %23
  %26 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %.unpack1276.unpack.unpack1278, %n.vec
  br i1 %cmp.n, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i.preheader1853

.lr.ph.i.preheader1853:                           ; preds = %.lr.ph.i.preheader, %middle.block
  %.ph1854 = phi i32 [ 0, %.lr.ph.i.preheader ], [ %26, %middle.block ]
  %.ph1855 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i.preheader1853, %.lr.ph.i
  %27 = phi i32 [ %32, %.lr.ph.i ], [ %.ph1854, %.lr.ph.i.preheader1853 ]
  %28 = phi i64 [ %33, %.lr.ph.i ], [ %.ph1855, %.lr.ph.i.preheader1853 ]
  %29 = shl i64 %28, 2
  %30 = getelementptr i8, ptr %.unpack1269, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !3
  %32 = add i32 %31, %27
  %33 = add nuw nsw i64 %28, 1
  %exitcond.not.i = icmp eq i64 %33, %.unpack1276.unpack.unpack1278
  br i1 %exitcond.not.i, label %_FortranASumInteger4x1_contract_simplified.exit, label %.lr.ph.i, !llvm.loop !12

_FortranASumInteger4x1_contract_simplified.exit:  ; preds = %.lr.ph.i, %middle.block, %0
  %.lcssa.i = phi i32 [ 0, %0 ], [ %26, %middle.block ], [ %32, %.lr.ph.i ]
  %34 = sext i32 %.lcssa.i to i64
  %35 = call i64 @llvm.smax.i64(i64 %34, i64 -1)
  %36 = add nsw i64 %35, 1
  %37 = shl nuw nsw i64 %36, 2
  %38 = call ptr @malloc(i64 %37)
  %39 = icmp eq i64 %36, 0
  %40 = zext i1 %39 to i64
  store ptr %38, ptr @_QFEv2.0, align 8, !tbaa !7
  store i64 %40, ptr @_QFEv2.7, align 8, !tbaa !7
  %41 = call i64 @llvm.smax.i64(i64 %34, i64 0)
  %42 = shl nuw nsw i64 %41, 2
  %43 = call ptr @malloc(i64 %42)
  store ptr %43, ptr @_QFEv3.0, align 8, !tbaa !7
  %44 = call ptr @malloc(i64 %37)
  store ptr %44, ptr @_QFEdp1.0, align 8, !tbaa !7
  store i64 %40, ptr @_QFEdp1.7, align 8, !tbaa !7
  store i64 %36, ptr @_QFEdp1.8, align 8, !tbaa !7
  %45 = call ptr @malloc(i64 %37)
  store ptr %45, ptr @_QFEdp2.0, align 8, !tbaa !7
  store i64 %40, ptr @_QFEdp2.7, align 8, !tbaa !7
  %.not = icmp eq ptr %38, null
  br i1 %.not, label %59, label %.preheader1628

.preheader1628:                                   ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %46 = icmp sgt i32 %.lcssa.i, -1
  br i1 %46, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader1628
  %47 = add i64 %35, 2
  %48 = icmp ne i64 %36, 0
  %umin.neg = sext i1 %48 to i64
  %49 = add i64 %47, %umin.neg
  %min.iters.check1696 = icmp ult i64 %49, 8
  br i1 %min.iters.check1696, label %.lr.ph.preheader1850, label %vector.ph1697

vector.ph1697:                                    ; preds = %.lr.ph.preheader
  %n.vec1699 = and i64 %49, -8
  %ind.end = sub i64 %36, %n.vec1699
  br label %vector.body1703

vector.body1703:                                  ; preds = %vector.body1703, %vector.ph1697
  %index1704 = phi i64 [ 0, %vector.ph1697 ], [ %index.next1705, %vector.body1703 ]
  %50 = getelementptr i32, ptr %38, i64 %index1704
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %50, align 4, !tbaa !3
  %51 = getelementptr i32, ptr %50, i64 4
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %51, align 4, !tbaa !3
  %index.next1705 = add nuw i64 %index1704, 8
  %52 = icmp eq i64 %index.next1705, %n.vec1699
  br i1 %52, label %middle.block1694, label %vector.body1703, !llvm.loop !13

middle.block1694:                                 ; preds = %vector.body1703
  %cmp.n1702 = icmp eq i64 %49, %n.vec1699
  br i1 %cmp.n1702, label %.loopexit, label %.lr.ph.preheader1850

.lr.ph.preheader1850:                             ; preds = %.lr.ph.preheader, %middle.block1694
  %.ph1851 = phi i64 [ %36, %.lr.ph.preheader ], [ %ind.end, %middle.block1694 ]
  %.ph1852 = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec1699, %middle.block1694 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader1850, %.lr.ph
  %53 = phi i64 [ %57, %.lr.ph ], [ %.ph1851, %.lr.ph.preheader1850 ]
  %54 = phi i64 [ %55, %.lr.ph ], [ %.ph1852, %.lr.ph.preheader1850 ]
  %55 = add nuw nsw i64 %54, 1
  %56 = getelementptr i32, ptr %38, i64 %54
  store i32 1000000000, ptr %56, align 4, !tbaa !3
  %57 = add nsw i64 %53, -1
  %58 = icmp ugt i64 %53, 1
  br i1 %58, label %.lr.ph, label %.loopexit, !llvm.loop !14

59:                                               ; preds = %_FortranASumInteger4x1_contract_simplified.exit
  %60 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.ebf34b8ca5385f9c746e87dc5856649e, i32 13)
  %.unpack1598.unpack.unpack = load i64, ptr @_QFEv2.7, align 8, !tbaa !7
  %61 = select i1 %39, i64 1, i64 %.unpack1598.unpack.unpack
  store i64 %61, ptr @_QFEv2.7, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %middle.block1694, %.preheader1628, %59
  %.unpack1336.unpack.unpack = phi i64 [ %40, %.preheader1628 ], [ %61, %59 ], [ %40, %middle.block1694 ], [ %40, %.lr.ph ]
  %62 = sub i64 0, %.unpack1336.unpack.unpack
  %63 = getelementptr i32, ptr %38, i64 %62
  store i32 0, ptr %63, align 4, !tbaa !3
  %64 = sub i64 %34, %.unpack1336.unpack.unpack
  %65 = getelementptr i32, ptr %38, i64 %64
  store i32 0, ptr %65, align 4, !tbaa !3
  %66 = load i32, ptr %3, align 4, !tbaa !3
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %.lr.ph1633, label %._crit_edge1641

.lr.ph1633:                                       ; preds = %.loopexit
  %68 = zext i32 %66 to i64
  %.unpack1555 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %.unpack1567 = load ptr, ptr @_QFEv.0, align 8, !tbaa !7
  br label %69

69:                                               ; preds = %.lr.ph1633, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph1633 ], [ %indvars.iv.next, %._crit_edge ]
  %.012141631 = phi i32 [ 0, %.lr.ph1633 ], [ %.pre-phi, %._crit_edge ]
  %70 = sext i32 %.012141631 to i64
  %71 = add nsw i64 %indvars.iv, -1
  %72 = getelementptr i32, ptr %.unpack1555, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !3
  %74 = add i32 %73, %.012141631
  %75 = sext i32 %74 to i64
  %76 = sub nsw i64 %75, %70
  %77 = add nsw i64 %indvars.iv, -1
  %78 = getelementptr i32, ptr %.unpack1567, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !3
  %80 = icmp sgt i64 %76, -1
  br i1 %80, label %.lr.ph1630, label %._crit_edge

.lr.ph1630:                                       ; preds = %69
  %81 = add nsw i64 %76, 1
  %82 = sub i64 %70, %.unpack1336.unpack.unpack
  %83 = add nsw i64 %75, 2
  %84 = icmp ne i64 %81, 0
  %umin1706.neg = sext i1 %84 to i64
  %85 = add nsw i64 %83, %umin1706.neg
  %86 = sub nsw i64 %85, %70
  %min.iters.check1709 = icmp ult i64 %86, 8
  br i1 %min.iters.check1709, label %scalar.ph1708.preheader, label %vector.ph1710

vector.ph1710:                                    ; preds = %.lr.ph1630
  %n.vec1712 = and i64 %86, -8
  %ind.end1713 = sub nsw i64 %81, %n.vec1712
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %79, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert1721 = insertelement <4 x i32> poison, i32 %79, i64 0
  %broadcast.splat1722 = shufflevector <4 x i32> %broadcast.splatinsert1721, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body1717

vector.body1717:                                  ; preds = %vector.body1717, %vector.ph1710
  %index1718 = phi i64 [ 0, %vector.ph1710 ], [ %index.next1723, %vector.body1717 ]
  %87 = add i64 %82, %index1718
  %88 = getelementptr i32, ptr %38, i64 %87
  %wide.load1719 = load <4 x i32>, ptr %88, align 4, !tbaa !3
  %89 = getelementptr i32, ptr %88, i64 4
  %wide.load1720 = load <4 x i32>, ptr %89, align 4, !tbaa !3
  %90 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load1719, <4 x i32> %broadcast.splat)
  %91 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load1720, <4 x i32> %broadcast.splat1722)
  store <4 x i32> %90, ptr %88, align 4, !tbaa !3
  store <4 x i32> %91, ptr %89, align 4, !tbaa !3
  %index.next1723 = add nuw i64 %index1718, 8
  %92 = icmp eq i64 %index.next1723, %n.vec1712
  br i1 %92, label %middle.block1707, label %vector.body1717, !llvm.loop !15

middle.block1707:                                 ; preds = %vector.body1717
  %cmp.n1716 = icmp eq i64 %86, %n.vec1712
  br i1 %cmp.n1716, label %._crit_edge.loopexit, label %scalar.ph1708.preheader

scalar.ph1708.preheader:                          ; preds = %.lr.ph1630, %middle.block1707
  %.ph1848 = phi i64 [ %81, %.lr.ph1630 ], [ %ind.end1713, %middle.block1707 ]
  %.ph1849 = phi i64 [ 0, %.lr.ph1630 ], [ %n.vec1712, %middle.block1707 ]
  br label %scalar.ph1708

scalar.ph1708:                                    ; preds = %scalar.ph1708.preheader, %scalar.ph1708
  %93 = phi i64 [ %100, %scalar.ph1708 ], [ %.ph1848, %scalar.ph1708.preheader ]
  %94 = phi i64 [ %99, %scalar.ph1708 ], [ %.ph1849, %scalar.ph1708.preheader ]
  %95 = add i64 %82, %94
  %96 = getelementptr i32, ptr %38, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !3
  %98 = call i32 @llvm.smin.i32(i32 %97, i32 %79)
  store i32 %98, ptr %96, align 4, !tbaa !3
  %99 = add nuw nsw i64 %94, 1
  %100 = add nsw i64 %93, -1
  %101 = icmp ugt i64 %93, 1
  br i1 %101, label %scalar.ph1708, label %._crit_edge.loopexit, !llvm.loop !16

._crit_edge.loopexit:                             ; preds = %scalar.ph1708, %middle.block1707
  %.pre = load i32, ptr %72, align 4, !tbaa !3
  %.pre1683 = add i32 %.pre, %.012141631
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %69
  %.pre-phi = phi i32 [ %.pre1683, %._crit_edge.loopexit ], [ %74, %69 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %68
  br i1 %exitcond.not, label %._crit_edge1634, label %69

._crit_edge1634:                                  ; preds = %._crit_edge
  br i1 %67, label %.lr.ph1640, label %._crit_edge1641

.lr.ph1640:                                       ; preds = %._crit_edge1634
  %102 = zext i32 %66 to i64
  %.unpack1495 = load ptr, ptr @_QFEv3.0, align 8, !tbaa !7
  %.unpack1507 = load ptr, ptr @_QFEt.0, align 8, !tbaa !7
  %.unpack1519 = load ptr, ptr @_QFEv.0, align 8, !tbaa !7
  br label %103

103:                                              ; preds = %.lr.ph1640, %._crit_edge1637
  %indvars.iv1662 = phi i64 [ 1, %.lr.ph1640 ], [ %indvars.iv.next1663, %._crit_edge1637 ]
  %.112151638 = phi i32 [ 0, %.lr.ph1640 ], [ %.pre-phi1685, %._crit_edge1637 ]
  %104 = add i32 %.112151638, 1
  %105 = sext i32 %104 to i64
  %106 = add nsw i64 %indvars.iv1662, -1
  %107 = getelementptr i32, ptr %.unpack1507, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !3
  %109 = add i32 %108, %.112151638
  %110 = sext i32 %109 to i64
  %111 = sub nsw i64 %110, %105
  %112 = add nsw i64 %indvars.iv1662, -1
  %113 = getelementptr i32, ptr %.unpack1519, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !3
  %115 = icmp sgt i64 %111, -1
  br i1 %115, label %.lr.ph1636, label %._crit_edge1637

.lr.ph1636:                                       ; preds = %103
  %116 = add nsw i64 %111, 1
  %117 = add nsw i64 %105, -1
  %118 = add nsw i64 %110, 2
  %119 = icmp ne i64 %116, 0
  %umin1724.neg = sext i1 %119 to i64
  %120 = add nsw i64 %118, %umin1724.neg
  %121 = sub nsw i64 %120, %105
  %min.iters.check1727 = icmp ult i64 %121, 8
  br i1 %min.iters.check1727, label %scalar.ph1726.preheader, label %vector.ph1728

vector.ph1728:                                    ; preds = %.lr.ph1636
  %n.vec1730 = and i64 %121, -8
  %ind.end1731 = sub nsw i64 %116, %n.vec1730
  %broadcast.splatinsert1737 = insertelement <4 x i32> poison, i32 %114, i64 0
  %broadcast.splat1738 = shufflevector <4 x i32> %broadcast.splatinsert1737, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert1739 = insertelement <4 x i32> poison, i32 %114, i64 0
  %broadcast.splat1740 = shufflevector <4 x i32> %broadcast.splatinsert1739, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body1735

vector.body1735:                                  ; preds = %vector.body1735, %vector.ph1728
  %index1736 = phi i64 [ 0, %vector.ph1728 ], [ %index.next1741, %vector.body1735 ]
  %122 = add i64 %117, %index1736
  %123 = getelementptr i32, ptr %.unpack1495, i64 %122
  store <4 x i32> %broadcast.splat1738, ptr %123, align 4, !tbaa !3
  %124 = getelementptr i32, ptr %123, i64 4
  store <4 x i32> %broadcast.splat1740, ptr %124, align 4, !tbaa !3
  %index.next1741 = add nuw i64 %index1736, 8
  %125 = icmp eq i64 %index.next1741, %n.vec1730
  br i1 %125, label %middle.block1725, label %vector.body1735, !llvm.loop !17

middle.block1725:                                 ; preds = %vector.body1735
  %cmp.n1734 = icmp eq i64 %121, %n.vec1730
  br i1 %cmp.n1734, label %._crit_edge1637.loopexit, label %scalar.ph1726.preheader

scalar.ph1726.preheader:                          ; preds = %.lr.ph1636, %middle.block1725
  %.ph1846 = phi i64 [ %116, %.lr.ph1636 ], [ %ind.end1731, %middle.block1725 ]
  %.ph1847 = phi i64 [ 0, %.lr.ph1636 ], [ %n.vec1730, %middle.block1725 ]
  br label %scalar.ph1726

scalar.ph1726:                                    ; preds = %scalar.ph1726.preheader, %scalar.ph1726
  %126 = phi i64 [ %131, %scalar.ph1726 ], [ %.ph1846, %scalar.ph1726.preheader ]
  %127 = phi i64 [ %130, %scalar.ph1726 ], [ %.ph1847, %scalar.ph1726.preheader ]
  %128 = add i64 %117, %127
  %129 = getelementptr i32, ptr %.unpack1495, i64 %128
  store i32 %114, ptr %129, align 4, !tbaa !3
  %130 = add nuw nsw i64 %127, 1
  %131 = add nsw i64 %126, -1
  %132 = icmp ugt i64 %126, 1
  br i1 %132, label %scalar.ph1726, label %._crit_edge1637.loopexit, !llvm.loop !18

._crit_edge1637.loopexit:                         ; preds = %scalar.ph1726, %middle.block1725
  %.pre1680 = load i32, ptr %107, align 4, !tbaa !3
  %.pre1684 = add i32 %.pre1680, %.112151638
  br label %._crit_edge1637

._crit_edge1637:                                  ; preds = %._crit_edge1637.loopexit, %103
  %.pre-phi1685 = phi i32 [ %.pre1684, %._crit_edge1637.loopexit ], [ %109, %103 ]
  %indvars.iv.next1663 = add nuw nsw i64 %indvars.iv1662, 1
  %exitcond1665.not = icmp eq i64 %indvars.iv1662, %102
  br i1 %exitcond1665.not, label %._crit_edge1641, label %103

._crit_edge1641:                                  ; preds = %._crit_edge1637, %.loopexit, %._crit_edge1634
  %.unpack1353 = load ptr, ptr @_QFEdp1.0, align 8, !tbaa !7
  %.unpack1360.unpack.unpack = load i64, ptr @_QFEdp1.7, align 8, !tbaa !7
  %133 = sub i64 0, %.unpack1360.unpack.unpack
  %134 = getelementptr i32, ptr %.unpack1353, i64 %133
  store i32 0, ptr %134, align 4, !tbaa !3
  %135 = icmp sgt i32 %.lcssa.i, 0
  br i1 %135, label %.lr.ph1643.preheader, label %._crit_edge1644

.lr.ph1643.preheader:                             ; preds = %._crit_edge1641
  %136 = mul i64 %.unpack1360.unpack.unpack, -4
  %uglygep1831 = getelementptr i8, ptr %.unpack1353, i64 %136
  %load_initial = load i32, ptr %uglygep1831, align 4
  %xtraiter = and i64 %34, 1
  %137 = icmp eq i32 %.lcssa.i, 1
  br i1 %137, label %._crit_edge1644.loopexit.unr-lcssa, label %.lr.ph1643.preheader.new

.lr.ph1643.preheader.new:                         ; preds = %.lr.ph1643.preheader
  %unroll_iter = and i64 %34, -2
  br label %.lr.ph1643

.lr.ph1643:                                       ; preds = %.lr.ph1643, %.lr.ph1643.preheader.new
  %store_forwarded = phi i32 [ %load_initial, %.lr.ph1643.preheader.new ], [ %149, %.lr.ph1643 ]
  %indvars.iv1666 = phi i64 [ 1, %.lr.ph1643.preheader.new ], [ %indvars.iv.next1667.1, %.lr.ph1643 ]
  %niter = phi i64 [ 0, %.lr.ph1643.preheader.new ], [ %niter.next.1, %.lr.ph1643 ]
  %138 = add i32 %store_forwarded, 1
  %139 = sub i64 %indvars.iv1666, %.unpack1336.unpack.unpack
  %140 = getelementptr i32, ptr %38, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !3
  %142 = call i32 @llvm.smin.i32(i32 %138, i32 %141)
  %143 = sub i64 %indvars.iv1666, %.unpack1360.unpack.unpack
  %144 = getelementptr i32, ptr %.unpack1353, i64 %143
  store i32 %142, ptr %144, align 4, !tbaa !3
  %indvars.iv.next1667 = add nuw nsw i64 %indvars.iv1666, 1
  %145 = add i32 %142, 1
  %146 = sub i64 %indvars.iv.next1667, %.unpack1336.unpack.unpack
  %147 = getelementptr i32, ptr %38, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !3
  %149 = call i32 @llvm.smin.i32(i32 %145, i32 %148)
  %150 = sub i64 %indvars.iv.next1667, %.unpack1360.unpack.unpack
  %151 = getelementptr i32, ptr %.unpack1353, i64 %150
  store i32 %149, ptr %151, align 4, !tbaa !3
  %indvars.iv.next1667.1 = add nuw nsw i64 %indvars.iv1666, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge1644.loopexit.unr-lcssa, label %.lr.ph1643

._crit_edge1644.loopexit.unr-lcssa:               ; preds = %.lr.ph1643, %.lr.ph1643.preheader
  %store_forwarded.unr = phi i32 [ %load_initial, %.lr.ph1643.preheader ], [ %149, %.lr.ph1643 ]
  %indvars.iv1666.unr = phi i64 [ 1, %.lr.ph1643.preheader ], [ %indvars.iv.next1667.1, %.lr.ph1643 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge1644, label %.lr.ph1643.epil

.lr.ph1643.epil:                                  ; preds = %._crit_edge1644.loopexit.unr-lcssa
  %152 = add i32 %store_forwarded.unr, 1
  %153 = sub i64 %indvars.iv1666.unr, %.unpack1336.unpack.unpack
  %154 = getelementptr i32, ptr %38, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !3
  %156 = call i32 @llvm.smin.i32(i32 %152, i32 %155)
  %157 = sub i64 %indvars.iv1666.unr, %.unpack1360.unpack.unpack
  %158 = getelementptr i32, ptr %.unpack1353, i64 %157
  store i32 %156, ptr %158, align 4, !tbaa !3
  br label %._crit_edge1644

._crit_edge1644:                                  ; preds = %.lr.ph1643.epil, %._crit_edge1644.loopexit.unr-lcssa, %._crit_edge1641
  %.unpack1365 = load ptr, ptr @_QFEdp2.0, align 8, !tbaa !7
  %.unpack13651753 = ptrtoint ptr %.unpack1365 to i64
  %.unpack1372.unpack.unpack = load i64, ptr @_QFEdp2.7, align 8, !tbaa !7
  %159 = sub i64 %34, %.unpack1372.unpack.unpack
  %160 = getelementptr i32, ptr %.unpack1365, i64 %159
  store i32 0, ptr %160, align 4, !tbaa !3
  %161 = sub i32 0, %.lcssa.i
  %162 = icmp slt i32 %161, 0
  br i1 %162, label %.lr.ph1647.preheader, label %._crit_edge1648.thread

._crit_edge1648.thread:                           ; preds = %._crit_edge1644
  %.unpack1384.unpack.unpack13861687 = load i64, ptr @_QFEdp1.8, align 8, !tbaa !7
  br label %237

.lr.ph1647.preheader:                             ; preds = %._crit_edge1644
  %163 = sext i32 %161 to i64
  %164 = sub nsw i64 0, %163
  %165 = sub nsw i64 0, %163
  %min.iters.check1757 = icmp ult i64 %165, 36
  br i1 %min.iters.check1757, label %.lr.ph1647.preheader1844, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph1647.preheader
  %166 = xor i64 %163, -1
  %167 = add i32 %.lcssa.i, -1
  %168 = trunc i64 %166 to i32
  %169 = sub i32 %167, %168
  %170 = icmp sgt i32 %169, %167
  %171 = trunc i64 %166 to i32
  %172 = sub i32 %.lcssa.i, %171
  %173 = icmp sgt i32 %172, %.lcssa.i
  %174 = icmp sgt i32 %161, -1
  %175 = or i1 %173, %174
  %176 = sext i32 %167 to i64
  %177 = sub i64 %176, %.unpack1372.unpack.unpack
  %178 = shl i64 %177, 2
  %uglygep = getelementptr i8, ptr %.unpack1365, i64 %178
  %.neg = shl nsw i64 %163, 2
  %mul.result1747.neg = add nsw i64 %.neg, 4
  %179 = getelementptr i8, ptr %uglygep, i64 %mul.result1747.neg
  %180 = icmp ugt ptr %179, %uglygep
  %181 = sub i64 %34, %.unpack1372.unpack.unpack
  %182 = shl i64 %181, 2
  %uglygep1749 = getelementptr i8, ptr %.unpack1365, i64 %182
  %.neg1832 = shl nsw i64 %163, 2
  %mul.result1751.neg = add nsw i64 %.neg1832, 4
  %183 = getelementptr i8, ptr %uglygep1749, i64 %mul.result1751.neg
  %184 = icmp ugt ptr %183, %uglygep1749
  %185 = or i1 %170, %175
  %186 = or i1 %180, %185
  %187 = or i1 %184, %186
  br i1 %187, label %.lr.ph1647.preheader1844, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %188 = shl nsw i64 %34, 2
  %189 = add i64 %188, %.unpack13651753
  %190 = shl i64 %.unpack1372.unpack.unpack, 2
  %191 = sub i64 %189, %190
  %192 = add i32 %.lcssa.i, -1
  %193 = sext i32 %192 to i64
  %194 = shl nsw i64 %193, 2
  %195 = add i64 %194, %.unpack13651753
  %.neg1833 = sub i64 %190, %195
  %196 = add i64 %.neg1833, %191
  %diff.check = icmp ult i64 %196, 32
  br i1 %diff.check, label %.lr.ph1647.preheader1844, label %vector.ph1758

vector.ph1758:                                    ; preds = %vector.memcheck
  %n.vec1760 = and i64 %165, -8
  %ind.end1761 = sub nsw i64 %164, %n.vec1760
  br label %vector.body1764

vector.body1764:                                  ; preds = %vector.body1764, %vector.ph1758
  %index1765 = phi i64 [ 0, %vector.ph1758 ], [ %index.next1775, %vector.body1764 ]
  %offset.idx = sub i64 %164, %index1765
  %197 = shl i64 %offset.idx, 32
  %198 = ashr exact i64 %197, 32
  %199 = sub i64 %198, %.unpack1372.unpack.unpack
  %200 = getelementptr i32, ptr %.unpack1365, i64 %199
  %201 = getelementptr i32, ptr %200, i64 -3
  %wide.load1766 = load <4 x i32>, ptr %201, align 4, !tbaa !3
  %202 = getelementptr i32, ptr %200, i64 -4
  %203 = getelementptr i32, ptr %202, i64 -3
  %wide.load1767 = load <4 x i32>, ptr %203, align 4, !tbaa !3
  %204 = add <4 x i32> %wide.load1766, <i32 1, i32 1, i32 1, i32 1>
  %205 = add <4 x i32> %wide.load1767, <i32 1, i32 1, i32 1, i32 1>
  %206 = shl i64 %offset.idx, 32
  %207 = add i64 %206, -4294967296
  %208 = ashr exact i64 %207, 32
  %209 = sub i64 %208, %.unpack1336.unpack.unpack
  %210 = getelementptr i32, ptr %38, i64 %209
  %211 = getelementptr i32, ptr %210, i64 -3
  %wide.load1769 = load <4 x i32>, ptr %211, align 4, !tbaa !3
  %212 = getelementptr i32, ptr %210, i64 -4
  %213 = getelementptr i32, ptr %212, i64 -3
  %wide.load1771 = load <4 x i32>, ptr %213, align 4, !tbaa !3
  %214 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %204, <4 x i32> %wide.load1769)
  %215 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %205, <4 x i32> %wide.load1771)
  %216 = sub i64 %208, %.unpack1372.unpack.unpack
  %217 = getelementptr i32, ptr %.unpack1365, i64 %216
  %218 = getelementptr i32, ptr %217, i64 -3
  store <4 x i32> %214, ptr %218, align 4, !tbaa !3
  %219 = getelementptr i32, ptr %217, i64 -4
  %220 = getelementptr i32, ptr %219, i64 -3
  store <4 x i32> %215, ptr %220, align 4, !tbaa !3
  %index.next1775 = add nuw i64 %index1765, 8
  %221 = icmp eq i64 %index.next1775, %n.vec1760
  br i1 %221, label %middle.block1755, label %vector.body1764, !llvm.loop !19

middle.block1755:                                 ; preds = %vector.body1764
  %cmp.n1763 = icmp eq i64 %n.vec1760, %165
  br i1 %cmp.n1763, label %._crit_edge1648, label %.lr.ph1647.preheader1844

.lr.ph1647.preheader1844:                         ; preds = %vector.memcheck, %vector.scevcheck, %.lr.ph1647.preheader, %middle.block1755
  %.ph1845 = phi i64 [ %164, %vector.memcheck ], [ %164, %vector.scevcheck ], [ %164, %.lr.ph1647.preheader ], [ %ind.end1761, %middle.block1755 ]
  br label %.lr.ph1647

.lr.ph1647:                                       ; preds = %.lr.ph1647.preheader1844, %.lr.ph1647
  %222 = phi i64 [ %223, %.lr.ph1647 ], [ %.ph1845, %.lr.ph1647.preheader1844 ]
  %223 = add nsw i64 %222, -1
  %sext = shl i64 %222, 32
  %224 = ashr exact i64 %sext, 32
  %225 = sub i64 %224, %.unpack1372.unpack.unpack
  %226 = getelementptr i32, ptr %.unpack1365, i64 %225
  %227 = load i32, ptr %226, align 4, !tbaa !3
  %228 = add i32 %227, 1
  %sext1686 = shl i64 %223, 32
  %229 = ashr exact i64 %sext1686, 32
  %230 = sub i64 %229, %.unpack1336.unpack.unpack
  %231 = getelementptr i32, ptr %38, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !3
  %233 = call i32 @llvm.smin.i32(i32 %228, i32 %232)
  %234 = sub i64 %229, %.unpack1372.unpack.unpack
  %235 = getelementptr i32, ptr %.unpack1365, i64 %234
  store i32 %233, ptr %235, align 4, !tbaa !3
  %236 = icmp ugt i64 %222, 1
  br i1 %236, label %.lr.ph1647, label %._crit_edge1648, !llvm.loop !20

._crit_edge1648:                                  ; preds = %.lr.ph1647, %middle.block1755
  %.unpack1384.unpack.unpack1386 = load i64, ptr @_QFEdp1.8, align 8, !tbaa !7
  %.not1401 = icmp eq ptr %.unpack1353, null
  br i1 %.not1401, label %._crit_edge1655, label %237

237:                                              ; preds = %._crit_edge1648.thread, %._crit_edge1648
  %.unpack1384.unpack.unpack13861689 = phi i64 [ %.unpack1384.unpack.unpack13861687, %._crit_edge1648.thread ], [ %.unpack1384.unpack.unpack1386, %._crit_edge1648 ]
  %238 = shl i64 %.unpack1384.unpack.unpack13861689, 2
  %239 = call ptr @malloc(i64 %238)
  %240 = icmp sgt i64 %.unpack1384.unpack.unpack13861689, 0
  br i1 %240, label %.lr.ph1651.preheader, label %.thread1626

.lr.ph1651.preheader:                             ; preds = %237
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %239, ptr nonnull align 4 %.unpack1353, i64 %238, i1 false), !tbaa !3
  %min.iters.check1778 = icmp ult i64 %.unpack1384.unpack.unpack13861689, 8
  br i1 %min.iters.check1778, label %.lr.ph1651.preheader1842, label %vector.ph1779

vector.ph1779:                                    ; preds = %.lr.ph1651.preheader
  %n.vec1781 = and i64 %.unpack1384.unpack.unpack13861689, -8
  br label %vector.body1784

vector.body1784:                                  ; preds = %vector.body1784, %vector.ph1779
  %index1785 = phi i64 [ 0, %vector.ph1779 ], [ %index.next1790, %vector.body1784 ]
  %241 = getelementptr i32, ptr %.unpack1353, i64 %index1785
  %wide.load1786 = load <4 x i32>, ptr %241, align 4, !tbaa !3
  %242 = getelementptr i32, ptr %241, i64 4
  %wide.load1787 = load <4 x i32>, ptr %242, align 4, !tbaa !3
  %243 = getelementptr i32, ptr %.unpack1365, i64 %index1785
  %wide.load1788 = load <4 x i32>, ptr %243, align 4, !tbaa !3
  %244 = getelementptr i32, ptr %243, i64 4
  %wide.load1789 = load <4 x i32>, ptr %244, align 4, !tbaa !3
  %245 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load1786, <4 x i32> %wide.load1788)
  %246 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load1787, <4 x i32> %wide.load1789)
  %247 = getelementptr i32, ptr %239, i64 %index1785
  store <4 x i32> %245, ptr %247, align 4, !tbaa !3
  %248 = getelementptr i32, ptr %247, i64 4
  store <4 x i32> %246, ptr %248, align 4, !tbaa !3
  %index.next1790 = add nuw i64 %index1785, 8
  %249 = icmp eq i64 %index.next1790, %n.vec1781
  br i1 %249, label %middle.block1776, label %vector.body1784, !llvm.loop !21

middle.block1776:                                 ; preds = %vector.body1784
  %cmp.n1783 = icmp eq i64 %.unpack1384.unpack.unpack13861689, %n.vec1781
  br i1 %cmp.n1783, label %.preheader, label %.lr.ph1651.preheader1842

.lr.ph1651.preheader1842:                         ; preds = %.lr.ph1651.preheader, %middle.block1776
  %.ph1843 = phi i64 [ 0, %.lr.ph1651.preheader ], [ %n.vec1781, %middle.block1776 ]
  br label %.lr.ph1651

.preheader:                                       ; preds = %.lr.ph1651, %middle.block1776
  br i1 %240, label %.lr.ph1652.preheader, label %.thread1626

.lr.ph1652.preheader:                             ; preds = %.preheader
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %.unpack1353, ptr nonnull align 4 %239, i64 %238, i1 false), !tbaa !3
  br label %.thread1626

.lr.ph1651:                                       ; preds = %.lr.ph1651.preheader1842, %.lr.ph1651
  %250 = phi i64 [ %256, %.lr.ph1651 ], [ %.ph1843, %.lr.ph1651.preheader1842 ]
  %251 = getelementptr i32, ptr %.unpack1353, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !3
  %253 = getelementptr i32, ptr %.unpack1365, i64 %250
  %254 = load i32, ptr %253, align 4, !tbaa !3
  %255 = call i32 @llvm.smin.i32(i32 %252, i32 %254)
  %256 = add nuw nsw i64 %250, 1
  %257 = getelementptr i32, ptr %239, i64 %250
  store i32 %255, ptr %257, align 4, !tbaa !3
  %exitcond1671.not = icmp eq i64 %256, %.unpack1384.unpack.unpack13861689
  br i1 %exitcond1671.not, label %.preheader, label %.lr.ph1651, !llvm.loop !22

.thread1626:                                      ; preds = %237, %.lr.ph1652.preheader, %.preheader
  call void @free(ptr %239)
  br label %261

._crit_edge1655:                                  ; preds = %._crit_edge1648
  %258 = shl i64 %.unpack1384.unpack.unpack1386, 2
  %259 = call ptr @malloc(i64 %258)
  %260 = icmp slt i64 %.unpack1384.unpack.unpack1386, 1
  call void @llvm.assume(i1 %260)
  store ptr %259, ptr @_QFEdp1.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEdp1.7, align 8, !tbaa !7
  br label %261

261:                                              ; preds = %.thread1626, %._crit_edge1655
  %.unpack1421.unpack.unpack = phi i64 [ %.unpack1360.unpack.unpack, %.thread1626 ], [ 1, %._crit_edge1655 ]
  %.unpack1414 = phi ptr [ %.unpack1353, %.thread1626 ], [ %259, %._crit_edge1655 ]
  br i1 %135, label %.lr.ph1658, label %._crit_edge1659

.lr.ph1658:                                       ; preds = %261
  %.unpack1426 = load ptr, ptr @_QFEv3.0, align 8, !tbaa !7
  %262 = xor i64 %.unpack1421.unpack.unpack, -1
  %min.iters.check1793 = icmp ult i32 %.lcssa.i, 8
  br i1 %min.iters.check1793, label %scalar.ph1792.preheader, label %vector.ph1794

vector.ph1794:                                    ; preds = %.lr.ph1658
  %n.vec1796 = and i64 %34, -8
  %ind.end1797 = or i64 %n.vec1796, 1
  br label %vector.body1800

vector.body1800:                                  ; preds = %vector.body1800, %vector.ph1794
  %index1801 = phi i64 [ 0, %vector.ph1794 ], [ %index.next1811, %vector.body1800 ]
  %vec.phi1802 = phi <4 x i32> [ zeroinitializer, %vector.ph1794 ], [ %279, %vector.body1800 ]
  %vec.phi1803 = phi <4 x i32> [ zeroinitializer, %vector.ph1794 ], [ %280, %vector.body1800 ]
  %offset.idx1804 = or i64 %index1801, 1
  %263 = add i64 %offset.idx1804, %262
  %264 = getelementptr i32, ptr %.unpack1414, i64 %263
  %wide.load1805 = load <4 x i32>, ptr %264, align 4, !tbaa !3
  %265 = getelementptr i32, ptr %264, i64 4
  %wide.load1806 = load <4 x i32>, ptr %265, align 4, !tbaa !3
  %266 = sub i64 %offset.idx1804, %.unpack1421.unpack.unpack
  %267 = getelementptr i32, ptr %.unpack1414, i64 %266
  %wide.load1807 = load <4 x i32>, ptr %267, align 4, !tbaa !3
  %268 = getelementptr i32, ptr %267, i64 4
  %wide.load1808 = load <4 x i32>, ptr %268, align 4, !tbaa !3
  %269 = icmp eq <4 x i32> %wide.load1805, %wide.load1807
  %270 = icmp eq <4 x i32> %wide.load1806, %wide.load1808
  %271 = getelementptr i32, ptr %.unpack1426, i64 %index1801
  %wide.load1809 = load <4 x i32>, ptr %271, align 4, !tbaa !3
  %272 = getelementptr i32, ptr %271, i64 4
  %wide.load1810 = load <4 x i32>, ptr %272, align 4, !tbaa !3
  %273 = icmp slt <4 x i32> %wide.load1807, %wide.load1809
  %274 = icmp slt <4 x i32> %wide.load1808, %wide.load1810
  %275 = and <4 x i1> %269, %273
  %276 = and <4 x i1> %270, %274
  %277 = zext <4 x i1> %275 to <4 x i32>
  %278 = zext <4 x i1> %276 to <4 x i32>
  %279 = add <4 x i32> %vec.phi1802, %277
  %280 = add <4 x i32> %vec.phi1803, %278
  %index.next1811 = add nuw i64 %index1801, 8
  %281 = icmp eq i64 %index.next1811, %n.vec1796
  br i1 %281, label %middle.block1791, label %vector.body1800, !llvm.loop !23

middle.block1791:                                 ; preds = %vector.body1800
  %bin.rdx1812 = add <4 x i32> %280, %279
  %282 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx1812)
  %cmp.n1799 = icmp eq i64 %n.vec1796, %34
  br i1 %cmp.n1799, label %._crit_edge1659.loopexit, label %scalar.ph1792.preheader

scalar.ph1792.preheader:                          ; preds = %.lr.ph1658, %middle.block1791
  %indvars.iv1673.ph = phi i64 [ 1, %.lr.ph1658 ], [ %ind.end1797, %middle.block1791 ]
  %.01656.ph = phi i32 [ 0, %.lr.ph1658 ], [ %282, %middle.block1791 ]
  br label %scalar.ph1792

scalar.ph1792:                                    ; preds = %scalar.ph1792.preheader, %scalar.ph1792
  %indvars.iv1673 = phi i64 [ %indvars.iv.next1674, %scalar.ph1792 ], [ %indvars.iv1673.ph, %scalar.ph1792.preheader ]
  %.01656 = phi i32 [ %spec.select, %scalar.ph1792 ], [ %.01656.ph, %scalar.ph1792.preheader ]
  %283 = add i64 %indvars.iv1673, %262
  %284 = getelementptr i32, ptr %.unpack1414, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !3
  %286 = sub i64 %indvars.iv1673, %.unpack1421.unpack.unpack
  %287 = getelementptr i32, ptr %.unpack1414, i64 %286
  %288 = load i32, ptr %287, align 4, !tbaa !3
  %289 = icmp eq i32 %285, %288
  %290 = add i64 %indvars.iv1673, -1
  %291 = getelementptr i32, ptr %.unpack1426, i64 %290
  %292 = load i32, ptr %291, align 4, !tbaa !3
  %293 = icmp slt i32 %288, %292
  %294 = and i1 %289, %293
  %295 = zext i1 %294 to i32
  %spec.select = add i32 %.01656, %295
  %indvars.iv.next1674 = add nuw nsw i64 %indvars.iv1673, 1
  %exitcond1677.not = icmp eq i64 %indvars.iv1673, %34
  br i1 %exitcond1677.not, label %._crit_edge1659.loopexit, label %scalar.ph1792, !llvm.loop !24

._crit_edge1659.loopexit:                         ; preds = %scalar.ph1792, %middle.block1791
  %spec.select.lcssa = phi i32 [ %282, %middle.block1791 ], [ %spec.select, %scalar.ph1792 ]
  %296 = sitofp i32 %spec.select.lcssa to double
  %297 = fmul contract double %296, 2.500000e-01
  br label %._crit_edge1659

._crit_edge1659:                                  ; preds = %._crit_edge1659.loopexit, %261
  %.0.lcssa = phi double [ 0.000000e+00, %261 ], [ %297, %._crit_edge1659.loopexit ]
  %298 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.2866302E3629, i64 6, ptr null, i32 -1, ptr nonnull @_QQcl.ebf34b8ca5385f9c746e87dc5856649e, i32 51)
  %.unpack1402 = load ptr, ptr @_QFEdp1.0, align 8, !tbaa !7
  %.unpack1409.unpack.unpack1411 = load i64, ptr @_QFEdp1.8, align 8, !tbaa !7
  %299 = icmp sgt i64 %.unpack1409.unpack.unpack1411, 0
  br i1 %299, label %.lr.ph.i1612.preheader, label %_FortranASumInteger4x1_contract_simplified.exit1615

.lr.ph.i1612.preheader:                           ; preds = %._crit_edge1659
  %min.iters.check1816 = icmp ult i64 %.unpack1409.unpack.unpack1411, 8
  br i1 %min.iters.check1816, label %.lr.ph.i1612.preheader1834, label %vector.ph1817

vector.ph1817:                                    ; preds = %.lr.ph.i1612.preheader
  %n.vec1819 = and i64 %.unpack1409.unpack.unpack1411, -8
  br label %vector.body1822

vector.body1822:                                  ; preds = %vector.body1822, %vector.ph1817
  %index1823 = phi i64 [ 0, %vector.ph1817 ], [ %index.next1828, %vector.body1822 ]
  %vec.phi1824 = phi <4 x i32> [ zeroinitializer, %vector.ph1817 ], [ %303, %vector.body1822 ]
  %vec.phi1825 = phi <4 x i32> [ zeroinitializer, %vector.ph1817 ], [ %304, %vector.body1822 ]
  %300 = shl i64 %index1823, 2
  %301 = getelementptr i8, ptr %.unpack1402, i64 %300
  %wide.load1826 = load <4 x i32>, ptr %301, align 4, !tbaa !3
  %302 = getelementptr i32, ptr %301, i64 4
  %wide.load1827 = load <4 x i32>, ptr %302, align 4, !tbaa !3
  %303 = add <4 x i32> %wide.load1826, %vec.phi1824
  %304 = add <4 x i32> %wide.load1827, %vec.phi1825
  %index.next1828 = add nuw i64 %index1823, 8
  %305 = icmp eq i64 %index.next1828, %n.vec1819
  br i1 %305, label %middle.block1814, label %vector.body1822, !llvm.loop !25

middle.block1814:                                 ; preds = %vector.body1822
  %bin.rdx1829 = add <4 x i32> %304, %303
  %306 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx1829)
  %cmp.n1821 = icmp eq i64 %.unpack1409.unpack.unpack1411, %n.vec1819
  br i1 %cmp.n1821, label %_FortranASumInteger4x1_contract_simplified.exit1615.loopexit, label %.lr.ph.i1612.preheader1834

.lr.ph.i1612.preheader1834:                       ; preds = %.lr.ph.i1612.preheader, %middle.block1814
  %.ph = phi i32 [ 0, %.lr.ph.i1612.preheader ], [ %306, %middle.block1814 ]
  %.ph1835 = phi i64 [ 0, %.lr.ph.i1612.preheader ], [ %n.vec1819, %middle.block1814 ]
  br label %.lr.ph.i1612

.lr.ph.i1612:                                     ; preds = %.lr.ph.i1612.preheader1834, %.lr.ph.i1612
  %307 = phi i32 [ %312, %.lr.ph.i1612 ], [ %.ph, %.lr.ph.i1612.preheader1834 ]
  %308 = phi i64 [ %313, %.lr.ph.i1612 ], [ %.ph1835, %.lr.ph.i1612.preheader1834 ]
  %309 = shl i64 %308, 2
  %310 = getelementptr i8, ptr %.unpack1402, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !3
  %312 = add i32 %311, %307
  %313 = add nuw nsw i64 %308, 1
  %exitcond.not.i1613 = icmp eq i64 %313, %.unpack1409.unpack.unpack1411
  br i1 %exitcond.not.i1613, label %_FortranASumInteger4x1_contract_simplified.exit1615.loopexit, label %.lr.ph.i1612, !llvm.loop !26

_FortranASumInteger4x1_contract_simplified.exit1615.loopexit: ; preds = %.lr.ph.i1612, %middle.block1814
  %.lcssa = phi i32 [ %306, %middle.block1814 ], [ %312, %.lr.ph.i1612 ]
  %314 = sitofp i32 %.lcssa to double
  br label %_FortranASumInteger4x1_contract_simplified.exit1615

_FortranASumInteger4x1_contract_simplified.exit1615: ; preds = %_FortranASumInteger4x1_contract_simplified.exit1615.loopexit, %._crit_edge1659
  %.lcssa.i1614 = phi double [ 0.000000e+00, %._crit_edge1659 ], [ %314, %_FortranASumInteger4x1_contract_simplified.exit1615.loopexit ]
  %315 = fadd contract double %.0.lcssa, %.lcssa.i1614
  %316 = call i1 @_FortranAioOutputReal64(ptr %298, double %315)
  %317 = call i32 @_FortranAioEndIoStatement(ptr %298)
  ret void
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputDescriptor(ptr, ptr) local_unnamed_addr

declare {} @_FortranAReportFatalUserError(ptr, ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputReal64(ptr, double) 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 nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite)
declare void @llvm.assume(i1 noundef) #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 <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
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, !11, !10}
!13 = distinct !{!13, !10, !11}
!14 = distinct !{!14, !11, !10}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !11, !10}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !11, !10}
!19 = distinct !{!19, !10, !11}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !11}
!22 = distinct !{!22, !11, !10}
!23 = distinct !{!23, !10, !11}
!24 = distinct !{!24, !11, !10}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !11, !10}
