program main
  implicit none
  integer(8) i,N
  integer(8),allocatable :: A(:),score(:)
  read(*, *) N
  allocate(A(N))
  allocate(score(N))
  read(*, *) (A(i), i = 1,N)
  do i = 1,N
    score(i) = i + A(i)*10**6
  end do
  !write(*, *) score
  call qsort(score)
  do i = 1,N
    score(i) = mod(score(i),10**6)
  end do
  write(*, *) score

  
contains

recursive subroutine qsort(a)
implicit none
!integer(8),intent(in) :: n
integer(8),intent(inout) :: a(:)
integer(8)::i,j,toobig,toosmall,pv,n
n = size(a)
i = 1
j = n
pv = a((i+j)/2)
do
   do
     if (a(i) < pv) then
       i = i+1
     else
       exit
     end if
   end do
   do
     if(a(j) > pv) then
       j = j-1
     else
       exit
     end if
   end do
   if (i>=j) then
     exit
   else
     toobig = a(j)
     toosmall = a(i)
     a(i) = toobig
     a(j) = toosmall
     i = i+1
     j = j-1
   end if
 end do
 if (i > 2) then
   call qsort(a(1:i-1))
 end if
 if (j < n-1) then
   call qsort(a(j+1:n))
 end if
end subroutine qsort
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"

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

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 i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a1235709fe6251ad1f436f4b9b7fae80, i32 5)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = load i64, ptr %3, align 8, !tbaa !3
  %8 = call i64 @llvm.smax.i64(i64 %7, i64 0)
  %9 = shl i64 %8, 3
  %10 = call ptr @malloc(i64 %9)
  store ptr %10, ptr @_QFEa.0, align 8, !tbaa !7
  %11 = call ptr @malloc(i64 %9)
  store ptr %11, ptr @_QFEscore.0, align 8, !tbaa !7
  store i64 %8, ptr @_QFEscore.8, align 8, !tbaa !7
  %12 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.a1235709fe6251ad1f436f4b9b7fae80, i32 8)
  %13 = load i64, ptr %3, align 8, !tbaa !3
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %15 = phi i64 [ %19, %.lr.ph ], [ 1, %0 ]
  %.unpack331 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %16 = add i64 %15, -1
  %17 = getelementptr i64, ptr %.unpack331, i64 %16
  %18 = call i1 @_FortranAioInputInteger(ptr %12, ptr %17, i32 8)
  %19 = add nuw i64 %15, 1
  %exitcond.not = icmp eq i64 %15, %13
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %20 = call i32 @_FortranAioEndIoStatement(ptr %12)
  %21 = load i64, ptr %3, align 8, !tbaa !3
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph344, label %._crit_edge.._crit_edge345_crit_edge

._crit_edge.._crit_edge345_crit_edge:             ; preds = %._crit_edge
  %.unpack.pre = load ptr, ptr @_QFEscore.0, align 8, !tbaa !7
  br label %._crit_edge345

.lr.ph344:                                        ; preds = %._crit_edge
  %.unpack307 = load ptr, ptr @_QFEa.0, align 8, !tbaa !7
  %.unpack319 = load ptr, ptr @_QFEscore.0, align 8, !tbaa !7
  %min.iters.check = icmp ult i64 %21, 4
  %.unpack319353 = ptrtoint ptr %.unpack319 to i64
  %.unpack307354 = ptrtoint ptr %.unpack307 to i64
  %23 = sub i64 %.unpack319353, %.unpack307354
  %diff.check = icmp ult i64 %23, 32
  %or.cond = select i1 %min.iters.check, i1 true, i1 %diff.check
  br i1 %or.cond, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph344
  %n.vec = and i64 %21, -4
  %ind.end = or i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 1, i64 2>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %24 = getelementptr i64, ptr %.unpack307, i64 %index
  %wide.load = load <2 x i64>, ptr %24, align 8, !tbaa !3
  %25 = getelementptr i64, ptr %24, i64 2
  %wide.load356 = load <2 x i64>, ptr %25, align 8, !tbaa !3
  %26 = mul <2 x i64> %wide.load, <i64 1000000, i64 1000000>
  %27 = mul <2 x i64> %wide.load356, <i64 1000000, i64 1000000>
  %28 = add <2 x i64> %26, %vec.ind
  %29 = add <2 x i64> %27, %step.add
  %30 = getelementptr i64, ptr %.unpack319, i64 %index
  store <2 x i64> %28, ptr %30, align 8, !tbaa !3
  %31 = getelementptr i64, ptr %30, i64 2
  store <2 x i64> %29, ptr %31, align 8, !tbaa !3
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %21, %n.vec
  br i1 %cmp.n, label %._crit_edge345, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %.lr.ph344, %middle.block
  %.ph = phi i64 [ 1, %.lr.ph344 ], [ %ind.end, %middle.block ]
  %xtraiter = and i64 %21, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %33 = add nsw i64 %.ph, -1
  %34 = getelementptr i64, ptr %.unpack307, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !3
  %36 = mul i64 %35, 1000000
  %37 = add i64 %36, %.ph
  %38 = add nsw i64 %.ph, -1
  %39 = getelementptr i64, ptr %.unpack319, i64 %38
  store i64 %37, ptr %39, align 8, !tbaa !3
  %40 = add nuw i64 %.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.unr = phi i64 [ %.ph, %scalar.ph.preheader ], [ %40, %scalar.ph.prol ]
  %41 = icmp eq i64 %21, %.ph
  br i1 %41, label %._crit_edge345, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %42 = phi i64 [ %56, %scalar.ph ], [ %.unr, %scalar.ph.prol.loopexit ]
  %43 = add i64 %42, -1
  %44 = getelementptr i64, ptr %.unpack307, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !3
  %46 = mul i64 %45, 1000000
  %47 = add i64 %46, %42
  %48 = add i64 %42, -1
  %49 = getelementptr i64, ptr %.unpack319, i64 %48
  store i64 %47, ptr %49, align 8, !tbaa !3
  %50 = add nuw i64 %42, 1
  %51 = getelementptr i64, ptr %.unpack307, i64 %42
  %52 = load i64, ptr %51, align 8, !tbaa !3
  %53 = mul i64 %52, 1000000
  %54 = add i64 %53, %50
  %55 = getelementptr i64, ptr %.unpack319, i64 %42
  store i64 %54, ptr %55, align 8, !tbaa !3
  %56 = add nuw i64 %42, 2
  %exitcond349.not.1 = icmp eq i64 %50, %21
  br i1 %exitcond349.not.1, label %._crit_edge345, label %scalar.ph, !llvm.loop !12

._crit_edge345:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %._crit_edge.._crit_edge345_crit_edge
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.._crit_edge345_crit_edge ], [ %.unpack319, %middle.block ], [ %.unpack319, %scalar.ph ], [ %.unpack319, %scalar.ph.prol.loopexit ]
  %.unpack278.unpack.unpack280 = load i64, ptr @_QFEscore.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 8, 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 10, 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 %.unpack278.unpack.unpack280, 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 8, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  call void @_QFPqsort(ptr nonnull %2)
  %57 = load i64, ptr %3, align 8, !tbaa !3
  %58 = icmp sgt i64 %57, 0
  br i1 %58, label %.lr.ph347.preheader, label %._crit_edge348

.lr.ph347.preheader:                              ; preds = %._crit_edge345
  %xtraiter357 = and i64 %57, 1
  %59 = icmp eq i64 %57, 1
  br i1 %59, label %._crit_edge348.loopexit.unr-lcssa, label %.lr.ph347.preheader.new

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

.lr.ph347:                                        ; preds = %.lr.ph347, %.lr.ph347.preheader.new
  %60 = phi i64 [ 1, %.lr.ph347.preheader.new ], [ %68, %.lr.ph347 ]
  %niter = phi i64 [ 0, %.lr.ph347.preheader.new ], [ %niter.next.1, %.lr.ph347 ]
  %61 = add nsw i64 %60, -1
  %62 = getelementptr i64, ptr %.unpack, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !3
  %64 = srem i64 %63, 1000000
  store i64 %64, ptr %62, align 8, !tbaa !3
  %65 = getelementptr i64, ptr %.unpack, i64 %60
  %66 = load i64, ptr %65, align 8, !tbaa !3
  %67 = srem i64 %66, 1000000
  store i64 %67, ptr %65, align 8, !tbaa !3
  %68 = add nuw i64 %60, 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_edge348.loopexit.unr-lcssa.loopexit, label %.lr.ph347

._crit_edge348.loopexit.unr-lcssa.loopexit:       ; preds = %.lr.ph347
  %69 = add i64 %60, 1
  br label %._crit_edge348.loopexit.unr-lcssa

._crit_edge348.loopexit.unr-lcssa:                ; preds = %._crit_edge348.loopexit.unr-lcssa.loopexit, %.lr.ph347.preheader
  %.unr358 = phi i64 [ 0, %.lr.ph347.preheader ], [ %69, %._crit_edge348.loopexit.unr-lcssa.loopexit ]
  %lcmp.mod359.not = icmp eq i64 %xtraiter357, 0
  br i1 %lcmp.mod359.not, label %._crit_edge348, label %.lr.ph347.epil

.lr.ph347.epil:                                   ; preds = %._crit_edge348.loopexit.unr-lcssa
  %70 = getelementptr i64, ptr %.unpack, i64 %.unr358
  %71 = load i64, ptr %70, align 8, !tbaa !3
  %72 = srem i64 %71, 1000000
  store i64 %72, ptr %70, align 8, !tbaa !3
  br label %._crit_edge348

._crit_edge348:                                   ; preds = %.lr.ph347.epil, %._crit_edge348.loopexit.unr-lcssa, %._crit_edge345
  %73 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.a1235709fe6251ad1f436f4b9b7fae80, i32 17)
  %.unpack283 = load ptr, ptr @_QFEscore.0, align 8, !tbaa !7
  %.unpack290.unpack.unpack292 = load i64, ptr @_QFEscore.8, align 8, !tbaa !7
  store ptr %.unpack283, ptr %1, align 8, !tbaa !7
  %.fca.1.gep115 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep115, align 8, !tbaa !7
  %.fca.2.gep117 = 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.gep117, align 8, !tbaa !7
  %.fca.3.gep119 = 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.gep119, align 4, !tbaa !7
  %.fca.4.gep121 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %1, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep121, align 1, !tbaa !7
  %.fca.5.gep123 = 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.gep123, align 2, !tbaa !7
  %.fca.6.gep125 = 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.gep125, align 1, !tbaa !7
  %.fca.7.0.0.gep127 = 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.gep127, align 8, !tbaa !7
  %.fca.7.0.1.gep129 = 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 %.unpack290.unpack.unpack292, ptr %.fca.7.0.1.gep129, align 8, !tbaa !7
  %.fca.7.0.2.gep131 = 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 8, ptr %.fca.7.0.2.gep131, align 8, !tbaa !7
  %74 = call i1 @_FortranAioOutputDescriptor(ptr %73, ptr nonnull %1)
  %75 = call i32 @_FortranAioEndIoStatement(ptr %73)
  ret void
}

; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QFPqsort(ptr nocapture readonly %0) local_unnamed_addr #1 {
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 1
  %5 = load i64, ptr %4, align 8, !tbaa !7
  %6 = add i64 %5, 1
  %7 = sdiv i64 %6, 2
  %8 = add nsw i64 %7, -1
  %9 = load ptr, ptr %0, align 8, !tbaa !7
  %10 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %11 = load i64, ptr %10, align 8, !tbaa !7
  %12 = mul i64 %8, %11
  %13 = getelementptr i8, ptr %9, i64 %12
  %14 = load i64, ptr %13, align 8, !tbaa !3
  br label %.outer

.outer:                                           ; preds = %44, %1
  %.045.ph = phi i64 [ %24, %44 ], [ %5, %1 ]
  %.0.ph = phi i64 [ %21, %44 ], [ 1, %1 ]
  br label %15

15:                                               ; preds = %15, %.outer
  %.0 = phi i64 [ %21, %15 ], [ %.0.ph, %.outer ]
  %16 = add i64 %.0, -1
  %17 = mul i64 %16, %11
  %18 = getelementptr i8, ptr %9, i64 %17
  %19 = load i64, ptr %18, align 8, !tbaa !3
  %20 = icmp slt i64 %19, %14
  %21 = add i64 %.0, 1
  br i1 %20, label %15, label %.preheader

.preheader:                                       ; preds = %15
  %22 = getelementptr i8, ptr %9, i64 %17
  br label %23

23:                                               ; preds = %.preheader, %23
  %.1 = phi i64 [ %24, %23 ], [ %.045.ph, %.preheader ]
  %24 = add i64 %.1, -1
  %25 = mul i64 %24, %11
  %26 = getelementptr i8, ptr %9, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !3
  %28 = icmp sgt i64 %27, %14
  br i1 %28, label %23, label %29

29:                                               ; preds = %23
  %.not = icmp slt i64 %.0, %.1
  br i1 %.not, label %44, label %30

30:                                               ; preds = %29
  %31 = icmp sgt i64 %.0, 2
  br i1 %31, label %32, label %33

32:                                               ; preds = %30
  store ptr %9, ptr %2, align 8, !tbaa !7
  %.fca.1.gep28 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep28, align 8, !tbaa !7
  %.fca.2.gep30 = 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.gep30, align 8, !tbaa !7
  %.fca.3.gep32 = 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.gep32, align 4, !tbaa !7
  %.fca.4.gep34 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %2, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep34, align 1, !tbaa !7
  %.fca.5.gep36 = 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.gep36, align 2, !tbaa !7
  %.fca.6.gep38 = 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.gep38, align 1, !tbaa !7
  %.fca.7.0.0.gep40 = 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.gep40, align 8, !tbaa !7
  %.fca.7.0.1.gep42 = 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 %16, ptr %.fca.7.0.1.gep42, align 8, !tbaa !7
  %.fca.7.0.2.gep44 = 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 %11, ptr %.fca.7.0.2.gep44, align 8, !tbaa !7
  call void @_QFPqsort(ptr nonnull %2)
  br label %33

33:                                               ; preds = %32, %30
  %34 = add i64 %5, -1
  %35 = icmp slt i64 %.1, %34
  br i1 %35, label %36, label %43

36:                                               ; preds = %33
  %37 = load i64, ptr %10, align 8, !tbaa !7
  %38 = load ptr, ptr %0, align 8, !tbaa !7
  %39 = mul i64 %37, %.1
  %40 = getelementptr i8, ptr %38, i64 %39
  %41 = sub i64 %5, %.1
  %42 = tail call i64 @llvm.smax.i64(i64 %41, i64 0)
  store ptr %40, ptr %3, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  store i64 8, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  store i8 10, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  store i64 %42, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  %.fca.7.0.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 2
  store i64 %37, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  call void @_QFPqsort(ptr nonnull %3)
  br label %43

43:                                               ; preds = %36, %33
  ret void

44:                                               ; preds = %29
  %45 = getelementptr i8, ptr %9, i64 %25
  store i64 %27, ptr %22, align 8, !tbaa !3
  store i64 %19, ptr %45, align 8, !tbaa !3
  br label %.outer
}

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

declare i1 @_FortranAioOutputDescriptor(ptr, ptr) local_unnamed_addr

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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

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