program prob6
    implicit none
    integer(16)::N, i, j, ans, cnt, maxd, maxa, sumd
    integer(16), allocatable::A(:), B(:), c(:), d(:)
    read(*,*) N
    allocate(A(N))
    allocate(B(N))
    allocate(c(N))
    allocate(d(N))
    read(*,*) A
    read(*,*) B

    d = 0
    cnt = 0
    j = 1
    do i = 1, N
        if(B(i) - A(i) > 0) then
            d(i) = B(i) - A(i)
            cnt = cnt + 1
        else if(B(i) - A(i) < 0) then
            c(j) = B(i) - A(i)
            j = j+1
        end if
    end do

    if(sum(d) == 0)then
        write(*,*) 0
        stop
    end if
    if(sum(B) > sum(A))then
        write(*,*) -1
        stop
    end if
    sumd = sum(d)
    call heapsort(j-1,c)

    do i = 1, j-1
        sumd = sumd + c(i)
        cnt = cnt + 1
        if(sumd <= 0) then
            write(*,*) cnt
            stop
        end if
    end do


    write(*,*) cnt

    deallocate(A)
    deallocate(B)
    deallocate(c)
    deallocate(d)
    stop
    contains
    subroutine heapsort(n,array)
        implicit none
        integer(16),intent(in) :: n
        integer(16),intent(inout) :: array(1:n)
       
        integer ::i,k,j,l
        double precision :: t
       
        if(n.le.0)then
           write(6,*)"Error, at heapsort"; stop
        endif
        if(n.eq.1)return
      
        l=n/2+1
        k=n
        do while(k.ne.1)
           if(l.gt.1)then
              l=l-1
              t=array(L)
           else
              t=array(k)
              array(k)=array(1)
              k=k-1
              if(k.eq.1) then
                 array(1)=t
                 exit
              endif
           endif
           i=l
           j=l+l
           do while(j.le.k)
              if(j.lt.k)then
                 if(array(j).lt.array(j+1))j=j+1
              endif
              if (t.lt.array(j))then
                 array(i)=array(j)
                 i=j
                 j=j+j
              else
                 j=k+1
              endif
           enddo
           array(i)=t
        enddo
      
        return
    end subroutine heapsort
end program prob6
; 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
@_QFEd.0 = internal unnamed_addr global ptr null
@_QFEd.7 = internal unnamed_addr global i64 1
@_QFEd.8 = internal unnamed_addr global i64 0
@_QQcl.63bedb41b5093c5b6b1f539392b92cc4 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_5125/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.4572726F722C2061742068656170736F7274 = linkonce constant [18 x i8] c"Error, at heapsort"
@_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

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #2 {
  %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 i128, align 8
  %4 = alloca i128, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 5)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %4, i32 16)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %8 = load i128, ptr %4, align 8, !tbaa !3
  %9 = trunc i128 %8 to i64
  %10 = call i64 @llvm.smax.i64(i64 %9, i64 0)
  %11 = shl i64 %10, 4
  %12 = call ptr @malloc(i64 %11)
  store ptr %12, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEa.8, align 8, !tbaa !7
  %13 = call ptr @malloc(i64 %11)
  store ptr %13, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 %10, ptr @_QFEb.8, align 8, !tbaa !7
  %14 = call ptr @malloc(i64 %11)
  store ptr %14, ptr @_QFEc.0, align 8, !tbaa !7
  %15 = call ptr @malloc(i64 %11)
  store ptr %15, ptr @_QFEd.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEd.7, align 8, !tbaa !7
  store i64 %10, ptr @_QFEd.8, align 8, !tbaa !7
  %16 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 10)
  %.unpack = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack1218.unpack.unpack1220 = load i64, ptr @_QFEa.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 16, 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 11, 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 %.unpack1218.unpack.unpack1220, 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 16, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %17 = call i1 @_FortranAioInputDescriptor(ptr %16, ptr nonnull %2)
  %18 = call i32 @_FortranAioEndIoStatement(ptr %16)
  %19 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 11)
  %.unpack1223 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack1230.unpack.unpack1232 = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  store ptr %.unpack1223, ptr %1, align 8, !tbaa !7
  %.fca.1.gep209 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 16, ptr %.fca.1.gep209, align 8, !tbaa !7
  %.fca.2.gep211 = 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.gep211, align 8, !tbaa !7
  %.fca.3.gep213 = 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.gep213, align 4, !tbaa !7
  %.fca.4.gep215 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 11, ptr %.fca.4.gep215, align 1, !tbaa !7
  %.fca.5.gep217 = 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.gep217, align 2, !tbaa !7
  %.fca.6.gep219 = 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.gep219, align 1, !tbaa !7
  %.fca.7.0.0.gep221 = 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.gep221, align 8, !tbaa !7
  %.fca.7.0.1.gep223 = 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 %.unpack1230.unpack.unpack1232, ptr %.fca.7.0.1.gep223, align 8, !tbaa !7
  %.fca.7.0.2.gep225 = 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 16, ptr %.fca.7.0.2.gep225, align 8, !tbaa !7
  %20 = call i1 @_FortranAioInputDescriptor(ptr %19, ptr nonnull %1)
  %21 = call i32 @_FortranAioEndIoStatement(ptr %19)
  %.unpack1235 = load ptr, ptr @_QFEd.0, align 8, !tbaa !7
  %.unpack1242.unpack.unpack1244 = load i64, ptr @_QFEd.8, align 8, !tbaa !7
  %.not = icmp eq ptr %.unpack1235, null
  br i1 %.not, label %24, label %.preheader

.preheader:                                       ; preds = %0
  %22 = icmp sgt i64 %.unpack1242.unpack.unpack1244, 0
  br i1 %22, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %23 = shl nuw i64 %.unpack1242.unpack.unpack1244, 4
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %.unpack1235, i8 0, i64 %23, i1 false), !tbaa !3
  br label %.loopexit

24:                                               ; preds = %0
  %25 = call {} @_FortranAReportFatalUserError(ptr nonnull @_QQcl.16373402fa3425c6e46827601abb88fa, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 13)
  %.unpack1422.unpack.unpack = load i64, ptr @_QFEd.7, align 8, !tbaa !7
  %26 = icmp eq i64 %.unpack1242.unpack.unpack1244, 0
  %27 = select i1 %26, i64 1, i64 %.unpack1422.unpack.unpack
  store ptr null, ptr @_QFEd.0, align 8, !tbaa !7
  store i64 %27, ptr @_QFEd.7, align 8, !tbaa !7
  store i64 %.unpack1242.unpack.unpack1244, ptr @_QFEd.8, align 8, !tbaa !7
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.preheader, %.preheader, %24
  %28 = load i128, ptr %4, align 8, !tbaa !3
  %29 = trunc i128 %28 to i64
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph1486, label %._crit_edge

.lr.ph1486:                                       ; preds = %.loopexit
  %.unpack1367 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack1379 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack1391 = load ptr, ptr @_QFEc.0, align 8
  %.unpack1410.unpack.unpack = load i64, ptr @_QFEd.7, align 8
  br label %31

31:                                               ; preds = %.lr.ph1486, %52
  %32 = phi i64 [ 1, %.lr.ph1486 ], [ %53, %52 ]
  %.011661485 = phi i128 [ 1, %.lr.ph1486 ], [ %.1, %52 ]
  %.011681484 = phi i128 [ 0, %.lr.ph1486 ], [ %.11169, %52 ]
  %33 = add i64 %32, -1
  %34 = getelementptr i128, ptr %.unpack1367, i64 %33
  %35 = load i128, ptr %34, align 8, !tbaa !3
  %36 = add i64 %32, -1
  %37 = getelementptr i128, ptr %.unpack1379, i64 %36
  %38 = load i128, ptr %37, align 8, !tbaa !3
  %39 = sub i128 %35, %38
  %40 = icmp sgt i128 %39, 0
  br i1 %40, label %41, label %45

41:                                               ; preds = %31
  %42 = sub i64 %32, %.unpack1410.unpack.unpack
  %43 = getelementptr i128, ptr %.unpack1235, i64 %42
  store i128 %39, ptr %43, align 8, !tbaa !3
  %44 = add i128 %.011681484, 1
  br label %52

45:                                               ; preds = %31
  %46 = icmp slt i128 %39, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %45
  %48 = trunc i128 %.011661485 to i64
  %49 = add i64 %48, -1
  %50 = getelementptr i128, ptr %.unpack1391, i64 %49
  store i128 %39, ptr %50, align 8, !tbaa !3
  %51 = add i128 %.011661485, 1
  br label %52

52:                                               ; preds = %41, %47, %45
  %.11169 = phi i128 [ %44, %41 ], [ %.011681484, %47 ], [ %.011681484, %45 ]
  %.1 = phi i128 [ %.011661485, %41 ], [ %51, %47 ], [ %.011661485, %45 ]
  %53 = add nuw i64 %32, 1
  %exitcond.not = icmp eq i64 %32, %29
  br i1 %exitcond.not, label %._crit_edge, label %31

._crit_edge:                                      ; preds = %52, %.loopexit
  %.01168.lcssa = phi i128 [ 0, %.loopexit ], [ %.11169, %52 ]
  %.01166.lcssa = phi i128 [ 1, %.loopexit ], [ %.1, %52 ]
  %54 = icmp sgt i64 %.unpack1242.unpack.unpack1244, 0
  br i1 %54, label %.lr.ph.i.preheader, label %_FortranASumInteger16x1_contract_simplified.exit.thread

.lr.ph.i.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %.unpack1242.unpack.unpack1244, 3
  %55 = icmp ult i64 %.unpack1242.unpack.unpack1244, 4
  br i1 %55, label %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa, label %.lr.ph.i.preheader.new

.lr.ph.i.preheader.new:                           ; preds = %.lr.ph.i.preheader
  %unroll_iter = and i64 %.unpack1242.unpack.unpack1244, -4
  br label %.lr.ph.i

.lr.ph.i:                                         ; preds = %.lr.ph.i, %.lr.ph.i.preheader.new
  %56 = phi i128 [ 0, %.lr.ph.i.preheader.new ], [ %76, %.lr.ph.i ]
  %57 = phi i64 [ 0, %.lr.ph.i.preheader.new ], [ %77, %.lr.ph.i ]
  %niter = phi i64 [ 0, %.lr.ph.i.preheader.new ], [ %niter.next.3, %.lr.ph.i ]
  %58 = shl i64 %57, 4
  %59 = getelementptr i8, ptr %.unpack1235, i64 %58
  %60 = load i128, ptr %59, align 8, !tbaa !3
  %61 = add i128 %60, %56
  %62 = shl i64 %57, 4
  %63 = or i64 %62, 16
  %64 = getelementptr i8, ptr %.unpack1235, i64 %63
  %65 = load i128, ptr %64, align 8, !tbaa !3
  %66 = add i128 %65, %61
  %67 = shl i64 %57, 4
  %68 = or i64 %67, 32
  %69 = getelementptr i8, ptr %.unpack1235, i64 %68
  %70 = load i128, ptr %69, align 8, !tbaa !3
  %71 = add i128 %70, %66
  %72 = shl i64 %57, 4
  %73 = or i64 %72, 48
  %74 = getelementptr i8, ptr %.unpack1235, i64 %73
  %75 = load i128, ptr %74, align 8, !tbaa !3
  %76 = add i128 %75, %71
  %77 = add nuw nsw i64 %57, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa, label %.lr.ph.i

_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa: ; preds = %.lr.ph.i, %.lr.ph.i.preheader
  %.lcssa1515.ph = phi i128 [ undef, %.lr.ph.i.preheader ], [ %76, %.lr.ph.i ]
  %.unr = phi i128 [ 0, %.lr.ph.i.preheader ], [ %76, %.lr.ph.i ]
  %.unr1516 = phi i64 [ 0, %.lr.ph.i.preheader ], [ %77, %.lr.ph.i ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %_FortranASumInteger16x1_contract_simplified.exit, label %.lr.ph.i.epil

.lr.ph.i.epil:                                    ; preds = %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa, %.lr.ph.i.epil
  %78 = phi i128 [ %83, %.lr.ph.i.epil ], [ %.unr, %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa ]
  %79 = phi i64 [ %84, %.lr.ph.i.epil ], [ %.unr1516, %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.i.epil ], [ 0, %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa ]
  %80 = shl i64 %79, 4
  %81 = getelementptr i8, ptr %.unpack1235, i64 %80
  %82 = load i128, ptr %81, align 8, !tbaa !3
  %83 = add i128 %82, %78
  %84 = add nuw nsw i64 %79, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %_FortranASumInteger16x1_contract_simplified.exit, label %.lr.ph.i.epil, !llvm.loop !9

_FortranASumInteger16x1_contract_simplified.exit: ; preds = %.lr.ph.i.epil, %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa
  %.lcssa1515 = phi i128 [ %.lcssa1515.ph, %_FortranASumInteger16x1_contract_simplified.exit.unr-lcssa ], [ %83, %.lr.ph.i.epil ]
  %85 = icmp eq i128 %.lcssa1515, 0
  br i1 %85, label %_FortranASumInteger16x1_contract_simplified.exit.thread, label %90

_FortranASumInteger16x1_contract_simplified.exit.thread: ; preds = %._crit_edge, %_FortranASumInteger16x1_contract_simplified.exit
  %86 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 27)
  %87 = call i1 @_FortranAioOutputInteger32(ptr %86, i32 0)
  %88 = call i32 @_FortranAioEndIoStatement(ptr %86)
  %89 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

90:                                               ; preds = %_FortranASumInteger16x1_contract_simplified.exit
  %.unpack1259 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  %.unpack1266.unpack.unpack1268 = load i64, ptr @_QFEb.8, align 8, !tbaa !7
  %91 = icmp sgt i64 %.unpack1266.unpack.unpack1268, 0
  br i1 %91, label %.lr.ph.i1436.preheader, label %_FortranASumInteger16x1_contract_simplified.exit1439

.lr.ph.i1436.preheader:                           ; preds = %90
  %xtraiter1518 = and i64 %.unpack1266.unpack.unpack1268, 3
  %92 = icmp ult i64 %.unpack1266.unpack.unpack1268, 4
  br i1 %92, label %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa, label %.lr.ph.i1436.preheader.new

.lr.ph.i1436.preheader.new:                       ; preds = %.lr.ph.i1436.preheader
  %unroll_iter1524 = and i64 %.unpack1266.unpack.unpack1268, -4
  br label %.lr.ph.i1436

.lr.ph.i1436:                                     ; preds = %.lr.ph.i1436, %.lr.ph.i1436.preheader.new
  %93 = phi i128 [ 0, %.lr.ph.i1436.preheader.new ], [ %113, %.lr.ph.i1436 ]
  %94 = phi i64 [ 0, %.lr.ph.i1436.preheader.new ], [ %114, %.lr.ph.i1436 ]
  %niter1525 = phi i64 [ 0, %.lr.ph.i1436.preheader.new ], [ %niter1525.next.3, %.lr.ph.i1436 ]
  %95 = shl i64 %94, 4
  %96 = getelementptr i8, ptr %.unpack1259, i64 %95
  %97 = load i128, ptr %96, align 8, !tbaa !3
  %98 = add i128 %97, %93
  %99 = shl i64 %94, 4
  %100 = or i64 %99, 16
  %101 = getelementptr i8, ptr %.unpack1259, i64 %100
  %102 = load i128, ptr %101, align 8, !tbaa !3
  %103 = add i128 %102, %98
  %104 = shl i64 %94, 4
  %105 = or i64 %104, 32
  %106 = getelementptr i8, ptr %.unpack1259, i64 %105
  %107 = load i128, ptr %106, align 8, !tbaa !3
  %108 = add i128 %107, %103
  %109 = shl i64 %94, 4
  %110 = or i64 %109, 48
  %111 = getelementptr i8, ptr %.unpack1259, i64 %110
  %112 = load i128, ptr %111, align 8, !tbaa !3
  %113 = add i128 %112, %108
  %114 = add nuw nsw i64 %94, 4
  %niter1525.next.3 = add i64 %niter1525, 4
  %niter1525.ncmp.3 = icmp eq i64 %niter1525.next.3, %unroll_iter1524
  br i1 %niter1525.ncmp.3, label %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa, label %.lr.ph.i1436

_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa: ; preds = %.lr.ph.i1436, %.lr.ph.i1436.preheader
  %.lcssa1514.ph = phi i128 [ undef, %.lr.ph.i1436.preheader ], [ %113, %.lr.ph.i1436 ]
  %.unr1520 = phi i128 [ 0, %.lr.ph.i1436.preheader ], [ %113, %.lr.ph.i1436 ]
  %.unr1521 = phi i64 [ 0, %.lr.ph.i1436.preheader ], [ %114, %.lr.ph.i1436 ]
  %lcmp.mod1522.not = icmp eq i64 %xtraiter1518, 0
  br i1 %lcmp.mod1522.not, label %_FortranASumInteger16x1_contract_simplified.exit1439, label %.lr.ph.i1436.epil

.lr.ph.i1436.epil:                                ; preds = %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa, %.lr.ph.i1436.epil
  %115 = phi i128 [ %120, %.lr.ph.i1436.epil ], [ %.unr1520, %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa ]
  %116 = phi i64 [ %121, %.lr.ph.i1436.epil ], [ %.unr1521, %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa ]
  %epil.iter1519 = phi i64 [ %epil.iter1519.next, %.lr.ph.i1436.epil ], [ 0, %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa ]
  %117 = shl i64 %116, 4
  %118 = getelementptr i8, ptr %.unpack1259, i64 %117
  %119 = load i128, ptr %118, align 8, !tbaa !3
  %120 = add i128 %119, %115
  %121 = add nuw nsw i64 %116, 1
  %epil.iter1519.next = add i64 %epil.iter1519, 1
  %epil.iter1519.cmp.not = icmp eq i64 %epil.iter1519.next, %xtraiter1518
  br i1 %epil.iter1519.cmp.not, label %_FortranASumInteger16x1_contract_simplified.exit1439, label %.lr.ph.i1436.epil, !llvm.loop !11

_FortranASumInteger16x1_contract_simplified.exit1439: ; preds = %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa, %.lr.ph.i1436.epil, %90
  %.lcssa.i1438 = phi i128 [ 0, %90 ], [ %.lcssa1514.ph, %_FortranASumInteger16x1_contract_simplified.exit1439.loopexit.unr-lcssa ], [ %120, %.lr.ph.i1436.epil ]
  %.unpack1271 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack1278.unpack.unpack1280 = load i64, ptr @_QFEa.8, align 8, !tbaa !7
  %122 = icmp sgt i64 %.unpack1278.unpack.unpack1280, 0
  br i1 %122, label %.lr.ph.i1440.preheader, label %_FortranASumInteger16x1_contract_simplified.exit1443

.lr.ph.i1440.preheader:                           ; preds = %_FortranASumInteger16x1_contract_simplified.exit1439
  %xtraiter1526 = and i64 %.unpack1278.unpack.unpack1280, 3
  %123 = icmp ult i64 %.unpack1278.unpack.unpack1280, 4
  br i1 %123, label %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa, label %.lr.ph.i1440.preheader.new

.lr.ph.i1440.preheader.new:                       ; preds = %.lr.ph.i1440.preheader
  %unroll_iter1532 = and i64 %.unpack1278.unpack.unpack1280, -4
  br label %.lr.ph.i1440

.lr.ph.i1440:                                     ; preds = %.lr.ph.i1440, %.lr.ph.i1440.preheader.new
  %124 = phi i128 [ 0, %.lr.ph.i1440.preheader.new ], [ %144, %.lr.ph.i1440 ]
  %125 = phi i64 [ 0, %.lr.ph.i1440.preheader.new ], [ %145, %.lr.ph.i1440 ]
  %niter1533 = phi i64 [ 0, %.lr.ph.i1440.preheader.new ], [ %niter1533.next.3, %.lr.ph.i1440 ]
  %126 = shl i64 %125, 4
  %127 = getelementptr i8, ptr %.unpack1271, i64 %126
  %128 = load i128, ptr %127, align 8, !tbaa !3
  %129 = add i128 %128, %124
  %130 = shl i64 %125, 4
  %131 = or i64 %130, 16
  %132 = getelementptr i8, ptr %.unpack1271, i64 %131
  %133 = load i128, ptr %132, align 8, !tbaa !3
  %134 = add i128 %133, %129
  %135 = shl i64 %125, 4
  %136 = or i64 %135, 32
  %137 = getelementptr i8, ptr %.unpack1271, i64 %136
  %138 = load i128, ptr %137, align 8, !tbaa !3
  %139 = add i128 %138, %134
  %140 = shl i64 %125, 4
  %141 = or i64 %140, 48
  %142 = getelementptr i8, ptr %.unpack1271, i64 %141
  %143 = load i128, ptr %142, align 8, !tbaa !3
  %144 = add i128 %143, %139
  %145 = add nuw nsw i64 %125, 4
  %niter1533.next.3 = add i64 %niter1533, 4
  %niter1533.ncmp.3 = icmp eq i64 %niter1533.next.3, %unroll_iter1532
  br i1 %niter1533.ncmp.3, label %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa, label %.lr.ph.i1440

_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa: ; preds = %.lr.ph.i1440, %.lr.ph.i1440.preheader
  %.lcssa1513.ph = phi i128 [ undef, %.lr.ph.i1440.preheader ], [ %144, %.lr.ph.i1440 ]
  %.unr1528 = phi i128 [ 0, %.lr.ph.i1440.preheader ], [ %144, %.lr.ph.i1440 ]
  %.unr1529 = phi i64 [ 0, %.lr.ph.i1440.preheader ], [ %145, %.lr.ph.i1440 ]
  %lcmp.mod1530.not = icmp eq i64 %xtraiter1526, 0
  br i1 %lcmp.mod1530.not, label %_FortranASumInteger16x1_contract_simplified.exit1443, label %.lr.ph.i1440.epil

.lr.ph.i1440.epil:                                ; preds = %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa, %.lr.ph.i1440.epil
  %146 = phi i128 [ %151, %.lr.ph.i1440.epil ], [ %.unr1528, %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa ]
  %147 = phi i64 [ %152, %.lr.ph.i1440.epil ], [ %.unr1529, %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa ]
  %epil.iter1527 = phi i64 [ %epil.iter1527.next, %.lr.ph.i1440.epil ], [ 0, %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa ]
  %148 = shl i64 %147, 4
  %149 = getelementptr i8, ptr %.unpack1271, i64 %148
  %150 = load i128, ptr %149, align 8, !tbaa !3
  %151 = add i128 %150, %146
  %152 = add nuw nsw i64 %147, 1
  %epil.iter1527.next = add i64 %epil.iter1527, 1
  %epil.iter1527.cmp.not = icmp eq i64 %epil.iter1527.next, %xtraiter1526
  br i1 %epil.iter1527.cmp.not, label %_FortranASumInteger16x1_contract_simplified.exit1443, label %.lr.ph.i1440.epil, !llvm.loop !12

_FortranASumInteger16x1_contract_simplified.exit1443: ; preds = %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa, %.lr.ph.i1440.epil, %_FortranASumInteger16x1_contract_simplified.exit1439
  %.lcssa.i1442 = phi i128 [ 0, %_FortranASumInteger16x1_contract_simplified.exit1439 ], [ %.lcssa1513.ph, %_FortranASumInteger16x1_contract_simplified.exit1443.loopexit.unr-lcssa ], [ %151, %.lr.ph.i1440.epil ]
  %153 = icmp sgt i128 %.lcssa.i1438, %.lcssa.i1442
  br i1 %153, label %155, label %.lr.ph.i1444.preheader

.lr.ph.i1444.preheader:                           ; preds = %_FortranASumInteger16x1_contract_simplified.exit1443
  %xtraiter1534 = and i64 %.unpack1242.unpack.unpack1244, 3
  %154 = icmp ult i64 %.unpack1242.unpack.unpack1244, 4
  br i1 %154, label %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa, label %.lr.ph.i1444.preheader.new

.lr.ph.i1444.preheader.new:                       ; preds = %.lr.ph.i1444.preheader
  %unroll_iter1540 = and i64 %.unpack1242.unpack.unpack1244, -4
  br label %.lr.ph.i1444

155:                                              ; preds = %_FortranASumInteger16x1_contract_simplified.exit1443
  %156 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 31)
  %157 = call i1 @_FortranAioOutputInteger32(ptr %156, i32 -1)
  %158 = call i32 @_FortranAioEndIoStatement(ptr %156)
  %159 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

.lr.ph.i1444:                                     ; preds = %.lr.ph.i1444, %.lr.ph.i1444.preheader.new
  %160 = phi i128 [ 0, %.lr.ph.i1444.preheader.new ], [ %180, %.lr.ph.i1444 ]
  %161 = phi i64 [ 0, %.lr.ph.i1444.preheader.new ], [ %181, %.lr.ph.i1444 ]
  %niter1541 = phi i64 [ 0, %.lr.ph.i1444.preheader.new ], [ %niter1541.next.3, %.lr.ph.i1444 ]
  %162 = shl i64 %161, 4
  %163 = getelementptr i8, ptr %.unpack1235, i64 %162
  %164 = load i128, ptr %163, align 8, !tbaa !3
  %165 = add i128 %164, %160
  %166 = shl i64 %161, 4
  %167 = or i64 %166, 16
  %168 = getelementptr i8, ptr %.unpack1235, i64 %167
  %169 = load i128, ptr %168, align 8, !tbaa !3
  %170 = add i128 %169, %165
  %171 = shl i64 %161, 4
  %172 = or i64 %171, 32
  %173 = getelementptr i8, ptr %.unpack1235, i64 %172
  %174 = load i128, ptr %173, align 8, !tbaa !3
  %175 = add i128 %174, %170
  %176 = shl i64 %161, 4
  %177 = or i64 %176, 48
  %178 = getelementptr i8, ptr %.unpack1235, i64 %177
  %179 = load i128, ptr %178, align 8, !tbaa !3
  %180 = add i128 %179, %175
  %181 = add nuw nsw i64 %161, 4
  %niter1541.next.3 = add i64 %niter1541, 4
  %niter1541.ncmp.3 = icmp eq i64 %niter1541.next.3, %unroll_iter1540
  br i1 %niter1541.ncmp.3, label %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa, label %.lr.ph.i1444

_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa: ; preds = %.lr.ph.i1444, %.lr.ph.i1444.preheader
  %.lcssa1512.ph = phi i128 [ undef, %.lr.ph.i1444.preheader ], [ %180, %.lr.ph.i1444 ]
  %.unr1536 = phi i128 [ 0, %.lr.ph.i1444.preheader ], [ %180, %.lr.ph.i1444 ]
  %.unr1537 = phi i64 [ 0, %.lr.ph.i1444.preheader ], [ %181, %.lr.ph.i1444 ]
  %lcmp.mod1538.not = icmp eq i64 %xtraiter1534, 0
  br i1 %lcmp.mod1538.not, label %_FortranASumInteger16x1_contract_simplified.exit1447, label %.lr.ph.i1444.epil

.lr.ph.i1444.epil:                                ; preds = %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa, %.lr.ph.i1444.epil
  %182 = phi i128 [ %187, %.lr.ph.i1444.epil ], [ %.unr1536, %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa ]
  %183 = phi i64 [ %188, %.lr.ph.i1444.epil ], [ %.unr1537, %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa ]
  %epil.iter1535 = phi i64 [ %epil.iter1535.next, %.lr.ph.i1444.epil ], [ 0, %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa ]
  %184 = shl i64 %183, 4
  %185 = getelementptr i8, ptr %.unpack1235, i64 %184
  %186 = load i128, ptr %185, align 8, !tbaa !3
  %187 = add i128 %186, %182
  %188 = add nuw nsw i64 %183, 1
  %epil.iter1535.next = add i64 %epil.iter1535, 1
  %epil.iter1535.cmp.not = icmp eq i64 %epil.iter1535.next, %xtraiter1534
  br i1 %epil.iter1535.cmp.not, label %_FortranASumInteger16x1_contract_simplified.exit1447, label %.lr.ph.i1444.epil, !llvm.loop !13

_FortranASumInteger16x1_contract_simplified.exit1447: ; preds = %.lr.ph.i1444.epil, %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa
  %.lcssa1512 = phi i128 [ %.lcssa1512.ph, %_FortranASumInteger16x1_contract_simplified.exit1447.unr-lcssa ], [ %187, %.lr.ph.i1444.epil ]
  %189 = add i128 %.01166.lcssa, -1
  store i128 %189, ptr %3, align 8, !tbaa !3
  %.unpack1295 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  call void @_QFPheapsort(ptr nonnull %3, ptr %.unpack1295)
  %190 = icmp sgt i128 %189, 0
  br i1 %190, label %.lr.ph1492, label %._crit_edge1493

.lr.ph1492:                                       ; preds = %_FortranASumInteger16x1_contract_simplified.exit1447
  %.unpack1355 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %191 = add i128 %.01166.lcssa, %.01168.lcssa
  %192 = add i128 %191, -1
  br label %193

193:                                              ; preds = %.lr.ph1492, %205
  %.01491 = phi i128 [ %.lcssa1512, %.lr.ph1492 ], [ %197, %205 ]
  %.011671490 = phi i64 [ 1, %.lr.ph1492 ], [ %207, %205 ]
  %.21489 = phi i128 [ %.01168.lcssa, %.lr.ph1492 ], [ %198, %205 ]
  %.011701488 = phi i128 [ %189, %.lr.ph1492 ], [ %206, %205 ]
  %194 = add i64 %.011671490, -1
  %195 = getelementptr i128, ptr %.unpack1355, i64 %194
  %196 = load i128, ptr %195, align 8, !tbaa !3
  %197 = add i128 %196, %.01491
  %198 = add i128 %.21489, 1
  %199 = icmp slt i128 %197, 1
  br i1 %199, label %200, label %205

200:                                              ; preds = %193
  %201 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 41)
  %202 = call i1 @_FortranAioOutputInteger128(ptr %201, i128 %198)
  %203 = call i32 @_FortranAioEndIoStatement(ptr %201)
  %204 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

205:                                              ; preds = %193
  %206 = add nsw i128 %.011701488, -1
  %207 = add i64 %.011671490, 1
  %208 = icmp sgt i128 %.011701488, 1
  br i1 %208, label %193, label %._crit_edge1493

._crit_edge1493:                                  ; preds = %205, %_FortranASumInteger16x1_contract_simplified.exit1447
  %.2.lcssa = phi i128 [ %.01168.lcssa, %_FortranASumInteger16x1_contract_simplified.exit1447 ], [ %192, %205 ]
  %209 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 47)
  %210 = call i1 @_FortranAioOutputInteger128(ptr %209, i128 %.2.lcssa)
  %211 = call i32 @_FortranAioEndIoStatement(ptr %209)
  %.unpack1307 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  call void @free(ptr %.unpack1307)
  store ptr null, ptr @_QFEa.0, align 8, !tbaa !7
  store i64 0, ptr @_QFEa.8, align 8, !tbaa !7
  %.unpack1319 = load ptr, ptr @_QFEb.0, align 8, !tbaa !7
  call void @free(ptr %.unpack1319)
  store ptr null, ptr @_QFEb.0, align 8, !tbaa !7
  store i64 0, ptr @_QFEb.8, align 8, !tbaa !7
  %.unpack1331 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  call void @free(ptr %.unpack1331)
  store ptr null, ptr @_QFEc.0, align 8, !tbaa !7
  %.unpack1343 = load ptr, ptr @_QFEd.0, align 8, !tbaa !7
  call void @free(ptr %.unpack1343)
  store ptr null, ptr @_QFEd.0, align 8, !tbaa !7
  store i64 1, ptr @_QFEd.7, align 8, !tbaa !7
  store i64 0, ptr @_QFEd.8, align 8, !tbaa !7
  %212 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

define void @_QFPheapsort(ptr nocapture readonly %0, ptr nocapture %1) local_unnamed_addr {
  %3 = load i128, ptr %0, align 8, !tbaa !3
  %4 = icmp slt i128 %3, 1
  br i1 %4, label %5, label %10

5:                                                ; preds = %2
  %6 = tail call ptr @_FortranAioBeginExternalListOutput(i32 6, ptr nonnull @_QQcl.63bedb41b5093c5b6b1f539392b92cc4, i32 64)
  %7 = tail call i1 @_FortranAioOutputAscii(ptr %6, ptr nonnull @_QQcl.4572726F722C2061742068656170736F7274, i64 18)
  %8 = tail call i32 @_FortranAioEndIoStatement(ptr %6)
  %9 = tail call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable

10:                                               ; preds = %2
  %11 = icmp eq i128 %3, 1
  br i1 %11, label %.loopexit, label %12

12:                                               ; preds = %10
  %13 = trunc i128 %3 to i32
  %.not50 = icmp eq i32 %13, 1
  br i1 %.not50, label %.loopexit, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %12
  %14 = lshr i128 %3, 1
  %15 = trunc i128 %14 to i32
  %16 = add i32 %15, 1
  br label %.lr.ph53

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %.split48.us
  %.02552 = phi i32 [ %.1, %.split48.us ], [ %16, %.lr.ph53.preheader ]
  %.02651 = phi i32 [ %.127.fr, %.split48.us ], [ %13, %.lr.ph53.preheader ]
  %17 = icmp sgt i32 %.02552, 1
  br i1 %17, label %18, label %25

18:                                               ; preds = %.lr.ph53
  %19 = add nsw i32 %.02552, -1
  %20 = zext i32 %19 to i64
  %21 = add nsw i64 %20, -1
  %22 = getelementptr i128, ptr %1, i64 %21
  %23 = load i128, ptr %22, align 8, !tbaa !3
  %24 = sitofp i128 %23 to double
  br label %36

25:                                               ; preds = %.lr.ph53
  %26 = sext i32 %.02651 to i64
  %27 = add nsw i64 %26, -1
  %28 = getelementptr i128, ptr %1, i64 %27
  %29 = load i128, ptr %28, align 8, !tbaa !3
  %30 = sitofp i128 %29 to double
  %31 = load i128, ptr %1, align 8, !tbaa !3
  store i128 %31, ptr %28, align 8, !tbaa !3
  %32 = add i32 %.02651, -1
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %34, label %36

34:                                               ; preds = %25
  %35 = fptosi double %30 to i128
  store i128 %35, ptr %1, align 8, !tbaa !3
  br label %.loopexit

36:                                               ; preds = %18, %25
  %.127 = phi i32 [ %.02651, %18 ], [ %32, %25 ]
  %.1 = phi i32 [ %19, %18 ], [ %.02552, %25 ]
  %.0 = phi double [ %24, %18 ], [ %30, %25 ]
  %.127.fr = freeze i32 %.127
  %37 = shl i32 %.1, 1
  %.not333542 = icmp sgt i32 %37, %.127.fr
  br i1 %.not333542, label %.split48.us, label %.lr.ph.lr.ph

.lr.ph.lr.ph:                                     ; preds = %36
  %.not33.not = icmp eq i32 %.127.fr, 2147483647
  br i1 %.not33.not, label %.lr.ph.preheader, label %.lr.ph.us

.lr.ph.preheader:                                 ; preds = %.lr.ph.lr.ph
  %.127.fr.le = freeze i32 %.127
  %38 = add i32 %.127.fr.le, 1
  %.not57 = icmp eq i32 %38, 2147483647
  %39 = sext i32 %38 to i64
  %40 = add nsw i64 %39, -1
  %41 = getelementptr i128, ptr %1, i64 %40
  %42 = getelementptr i128, ptr %1, i64 %39
  br label %64

.lr.ph.us:                                        ; preds = %.lr.ph.lr.ph, %.split.us.us
  %.028.ph44.us = phi i32 [ %63, %.split.us.us ], [ %37, %.lr.ph.lr.ph ]
  %.030.ph43.us = phi i32 [ %.129.us.us, %.split.us.us ], [ %.1, %.lr.ph.lr.ph ]
  %43 = icmp slt i32 %.028.ph44.us, %.127.fr
  br i1 %43, label %44, label %53

44:                                               ; preds = %.lr.ph.us
  %45 = sext i32 %.028.ph44.us to i64
  %46 = add nsw i64 %45, -1
  %47 = getelementptr i128, ptr %1, i64 %46
  %48 = load i128, ptr %47, align 8, !tbaa !3
  %49 = getelementptr i128, ptr %1, i64 %45
  %50 = load i128, ptr %49, align 8, !tbaa !3
  %51 = icmp slt i128 %48, %50
  %52 = zext i1 %51 to i32
  %spec.select.us.us = or i32 %.028.ph44.us, %52
  br label %53

53:                                               ; preds = %44, %.lr.ph.us
  %.129.us.us = phi i32 [ %.028.ph44.us, %.lr.ph.us ], [ %spec.select.us.us, %44 ]
  %54 = sext i32 %.129.us.us to i64
  %55 = add nsw i64 %54, -1
  %56 = getelementptr i128, ptr %1, i64 %55
  %57 = load i128, ptr %56, align 8, !tbaa !3
  %58 = sitofp i128 %57 to double
  %59 = fcmp olt double %.0, %58
  br i1 %59, label %.split.us.us, label %.split48.us

.split.us.us:                                     ; preds = %53
  %60 = sext i32 %.030.ph43.us to i64
  %61 = add nsw i64 %60, -1
  %62 = getelementptr i128, ptr %1, i64 %61
  store i128 %57, ptr %62, align 8, !tbaa !3
  %63 = shl i32 %.129.us.us, 1
  %.not3335.us = icmp sgt i32 %63, %.127.fr
  br i1 %.not3335.us, label %.split48.us, label %.lr.ph.us

64:                                               ; preds = %.split, %.lr.ph.preheader
  %.028.ph44 = phi i32 [ %94, %.split ], [ %37, %.lr.ph.preheader ]
  %.030.ph43 = phi i32 [ %.129.lcssa, %.split ], [ %.1, %.lr.ph.preheader ]
  %65 = sext i32 %.028.ph44 to i64
  %66 = add nsw i64 %65, -1
  %67 = getelementptr i128, ptr %1, i64 %66
  %68 = load i128, ptr %67, align 8, !tbaa !3
  %69 = getelementptr i128, ptr %1, i64 %65
  %70 = load i128, ptr %69, align 8, !tbaa !3
  %71 = icmp slt i128 %68, %70
  %72 = zext i1 %71 to i32
  %spec.select.peel = or i32 %.028.ph44, %72
  %73 = sext i32 %spec.select.peel to i64
  %74 = add nsw i64 %73, -1
  %75 = getelementptr i128, ptr %1, i64 %74
  %76 = load i128, ptr %75, align 8, !tbaa !3
  %77 = sitofp i128 %76 to double
  %78 = fcmp olt double %.0, %77
  br i1 %78, label %.split, label %.peel.next

.peel.next:                                       ; preds = %64, %84
  br i1 %.not57, label %84, label %79

79:                                               ; preds = %.peel.next
  %80 = load i128, ptr %41, align 8, !tbaa !3
  %81 = load i128, ptr %42, align 8, !tbaa !3
  %82 = icmp slt i128 %80, %81
  %83 = zext i1 %82 to i32
  %spec.select = add nsw i32 %38, %83
  br label %84

84:                                               ; preds = %79, %.peel.next
  %.129 = phi i32 [ 2147483647, %.peel.next ], [ %spec.select, %79 ]
  %85 = sext i32 %.129 to i64
  %86 = add nsw i64 %85, -1
  %87 = getelementptr i128, ptr %1, i64 %86
  %88 = load i128, ptr %87, align 8, !tbaa !3
  %89 = sitofp i128 %88 to double
  %90 = fcmp olt double %.0, %89
  br i1 %90, label %.split, label %.peel.next, !llvm.loop !14

.split:                                           ; preds = %84, %64
  %.129.lcssa = phi i32 [ %spec.select.peel, %64 ], [ %.129, %84 ]
  %.lcssa = phi i128 [ %76, %64 ], [ %88, %84 ]
  %91 = sext i32 %.030.ph43 to i64
  %92 = add nsw i64 %91, -1
  %93 = getelementptr i128, ptr %1, i64 %92
  store i128 %.lcssa, ptr %93, align 8, !tbaa !3
  %94 = shl i32 %.129.lcssa, 1
  br label %64

.split48.us:                                      ; preds = %.split.us.us, %53, %36
  %.030.ph.lcssa = phi i32 [ %.1, %36 ], [ %.030.ph43.us, %53 ], [ %.129.us.us, %.split.us.us ]
  %95 = fptosi double %.0 to i128
  %96 = sext i32 %.030.ph.lcssa to i64
  %97 = add nsw i64 %96, -1
  %98 = getelementptr i128, ptr %1, i64 %97
  store i128 %95, ptr %98, align 8, !tbaa !3
  %.not = icmp eq i32 %.127.fr, 1
  br i1 %.not, label %.loopexit, label %.lr.ph53

.loopexit:                                        ; preds = %.split48.us, %12, %34, %10
  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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

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

declare i1 @_FortranAioOutputInteger128(ptr, i128) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { noreturn }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }

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

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
!7 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.peeled.count", i32 1}
