program test
  implicit none
  integer :: n, a(100), k, l, i
  a=0
  k=0
  l=0
  read(*,*) n
  read(*,*) a(1:n)
  call quick_sort(a(1:n))
  do i=1,n
  	if(mod(i,2)==1)then
    	k=k+a(n-i+1)
    else
    	l=l+a(n-i+1)
    end if
  end do
  write(*,*)k-l
  stop
contains
  recursive subroutine quick_sort(a)
    implicit none
    integer, intent(inout) :: a(:)
    integer :: p, c
    integer :: n, l, r
    n = size(a)
    l = 1
    r = n
    p = a((l+r)/2)+a(l)+a(r)-max(a((l+r)/2),a(l),a(r))-min(a((l+r)/2),a(l),a(r))
    do
      do while (a(l).lt.p)
        l = l+1
      end do
      do while (a(r).gt.p)
        r = r-1
      end do
      if (l.ge.r) exit
      c = a(l)
      a(l) = a(r)
      a(r) = c
      l = l+1
      r = r-1
    end do
    if (l.gt.2) call quick_sort(a(1:l-1))
    if (n.gt.r+1) call quick_sort(a(r+1:n))
  end subroutine quick_sort
end program test
; 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 = internal global [100 x i32] undef
@_QQcl.1fed8761bc1761ff4e650f948d023c86 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6263/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %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
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @_QFEa, i8 0, i64 400, i1 false), !tbaa !3
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.1fed8761bc1761ff4e650f948d023c86, i32 7)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 4)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.1fed8761bc1761ff4e650f948d023c86, i32 8)
  %8 = load i32, ptr %3, align 4, !tbaa !3
  %9 = call i32 @llvm.smax.i32(i32 %8, i32 0)
  %10 = zext i32 %9 to i64
  store ptr @_QFEa, 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 %10, 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
  %11 = call i1 @_FortranAioInputDescriptor(ptr %7, ptr nonnull %2)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %13 = load i32, ptr %3, align 4, !tbaa !3
  %14 = call i32 @llvm.smax.i32(i32 %13, i32 0)
  %15 = zext i32 %14 to i64
  store ptr @_QFEa, ptr %1, align 8, !tbaa !7
  %.fca.1.gep11 = 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.gep11, align 8, !tbaa !7
  %.fca.2.gep13 = 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.gep13, align 8, !tbaa !7
  %.fca.3.gep15 = 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.gep15, align 4, !tbaa !7
  %.fca.4.gep17 = 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.gep17, align 1, !tbaa !7
  %.fca.5.gep19 = 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.gep19, align 2, !tbaa !7
  %.fca.6.gep21 = 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.gep21, align 1, !tbaa !7
  %.fca.7.0.0.gep23 = 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.gep23, align 8, !tbaa !7
  %.fca.7.0.1.gep25 = 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 %15, ptr %.fca.7.0.1.gep25, align 8, !tbaa !7
  %.fca.7.0.2.gep27 = 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.gep27, align 8, !tbaa !7
  call void @_QFPquick_sort(ptr nonnull %1)
  %16 = load i32, ptr %3, align 4, !tbaa !3
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %18 = zext i32 %16 to i64
  %19 = add nuw i32 %16, 1
  %min.iters.check = icmp ult i32 %16, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

vector.scevcheck:                                 ; preds = %.lr.ph
  %20 = add nsw i64 %18, -1
  %21 = trunc i64 %20 to i32
  %22 = sub i32 %16, %21
  %23 = icmp sgt i32 %22, %16
  %24 = icmp ugt i64 %20, 4294967295
  %25 = or i1 %23, %24
  br i1 %25, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.scevcheck
  %n.vec = and i64 %18, 4294967288
  %ind.end = or i64 %n.vec, 1
  %ind.end42 = xor 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 <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %43, %vector.body ]
  %vec.phi45 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %44, %vector.body ]
  %vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
  %vec.phi47 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
  %step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
  %26 = trunc i64 %index to i32
  %27 = and <4 x i64> %vec.ind, <i64 2147483649, i64 2147483649, i64 2147483649, i64 2147483649>
  %28 = and <4 x i64> %step.add, <i64 2147483649, i64 2147483649, i64 2147483649, i64 2147483649>
  %29 = icmp eq <4 x i64> %27, <i64 1, i64 1, i64 1, i64 1>
  %30 = icmp eq <4 x i64> %28, <i64 1, i64 1, i64 1, i64 1>
  %31 = sub i32 %16, %26
  %32 = sext i32 %31 to i64
  %33 = add nsw i64 %32, -1
  %34 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %33
  %35 = getelementptr i32, ptr %34, i64 -3
  %wide.load = load <4 x i32>, ptr %35, align 4, !tbaa !3
  %reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %36 = getelementptr i32, ptr %34, i64 -7
  %wide.load48 = load <4 x i32>, ptr %36, align 4, !tbaa !3
  %reverse49 = shufflevector <4 x i32> %wide.load48, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
  %37 = select <4 x i1> %29, <4 x i32> %reverse, <4 x i32> zeroinitializer
  %38 = select <4 x i1> %30, <4 x i32> %reverse49, <4 x i32> zeroinitializer
  %39 = add <4 x i32> %vec.phi46, %37
  %40 = add <4 x i32> %vec.phi47, %38
  %41 = select <4 x i1> %29, <4 x i32> zeroinitializer, <4 x i32> %reverse
  %42 = select <4 x i1> %30, <4 x i32> zeroinitializer, <4 x i32> %reverse49
  %43 = add <4 x i32> %vec.phi, %41
  %44 = add <4 x i32> %vec.phi45, %42
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %45 = icmp eq i64 %index.next, %n.vec
  br i1 %45, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx50 = add <4 x i32> %40, %39
  %46 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx50)
  %bin.rdx = add <4 x i32> %44, %43
  %47 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %18
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %vector.scevcheck, %.lr.ph, %middle.block
  %indvars.iv36.ph = phi i64 [ 1, %vector.scevcheck ], [ 1, %.lr.ph ], [ %ind.end, %middle.block ]
  %indvars.iv.ph = phi i64 [ -1, %vector.scevcheck ], [ -1, %.lr.ph ], [ %ind.end42, %middle.block ]
  %.033.ph = phi i32 [ 0, %vector.scevcheck ], [ 0, %.lr.ph ], [ %47, %middle.block ]
  %.02832.ph = phi i32 [ 0, %vector.scevcheck ], [ 0, %.lr.ph ], [ %46, %middle.block ]
  %xtraiter = and i64 %18, 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
  %48 = and i64 %indvars.iv36.ph, 2147483649
  %49 = icmp eq i64 %48, 1
  %50 = trunc i64 %indvars.iv.ph to i32
  %51 = add i32 %19, %50
  %52 = sext i32 %51 to i64
  %53 = add nsw i64 %52, -1
  %54 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !3
  %56 = select i1 %49, i32 %55, i32 0
  %.129.prol = add i32 %.02832.ph, %56
  %57 = select i1 %49, i32 0, i32 %55
  %.1.prol = add i32 %.033.ph, %57
  %indvars.iv.next37.prol = add nuw nsw i64 %indvars.iv36.ph, 1
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.ph, -1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.129.lcssa.unr = phi i32 [ undef, %scalar.ph.preheader ], [ %.129.prol, %scalar.ph.prol ]
  %.1.lcssa.unr = phi i32 [ undef, %scalar.ph.preheader ], [ %.1.prol, %scalar.ph.prol ]
  %indvars.iv36.unr = phi i64 [ %indvars.iv36.ph, %scalar.ph.preheader ], [ %indvars.iv.next37.prol, %scalar.ph.prol ]
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %.033.unr = phi i32 [ %.033.ph, %scalar.ph.preheader ], [ %.1.prol, %scalar.ph.prol ]
  %.02832.unr = phi i32 [ %.02832.ph, %scalar.ph.preheader ], [ %.129.prol, %scalar.ph.prol ]
  %58 = icmp eq i64 %indvars.iv36.ph, %18
  br i1 %58, label %._crit_edge, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv36 = phi i64 [ %indvars.iv.next37.1, %scalar.ph ], [ %indvars.iv36.unr, %scalar.ph.prol.loopexit ]
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %.033 = phi i32 [ %.1.1, %scalar.ph ], [ %.033.unr, %scalar.ph.prol.loopexit ]
  %.02832 = phi i32 [ %.129.1, %scalar.ph ], [ %.02832.unr, %scalar.ph.prol.loopexit ]
  %59 = and i64 %indvars.iv36, 2147483649
  %60 = icmp eq i64 %59, 1
  %61 = trunc i64 %indvars.iv to i32
  %62 = add i32 %19, %61
  %63 = sext i32 %62 to i64
  %64 = add nsw i64 %63, -1
  %65 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !3
  %67 = select i1 %60, i32 %66, i32 0
  %.129 = add i32 %.02832, %67
  %68 = select i1 %60, i32 0, i32 %66
  %.1 = add i32 %.033, %68
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %69 = and i64 %indvars.iv.next37, 2147483649
  %70 = icmp eq i64 %69, 1
  %71 = trunc i64 %indvars.iv to i32
  %72 = add i32 %16, %71
  %73 = sext i32 %72 to i64
  %74 = add nsw i64 %73, -1
  %75 = getelementptr [100 x i32], ptr @_QFEa, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !3
  %77 = select i1 %70, i32 %76, i32 0
  %.129.1 = add i32 %.129, %77
  %78 = select i1 %70, i32 0, i32 %76
  %.1.1 = add i32 %.1, %78
  %indvars.iv.next37.1 = add nuw nsw i64 %indvars.iv36, 2
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next37, %18
  br i1 %exitcond.not.1, label %._crit_edge, label %scalar.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %0
  %.028.lcssa = phi i32 [ 0, %0 ], [ %46, %middle.block ], [ %.129.lcssa.unr, %scalar.ph.prol.loopexit ], [ %.129.1, %scalar.ph ]
  %.0.lcssa = phi i32 [ 0, %0 ], [ %47, %middle.block ], [ %.1.lcssa.unr, %scalar.ph.prol.loopexit ], [ %.1.1, %scalar.ph ]
  %79 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.1fed8761bc1761ff4e650f948d023c86, i32 17)
  %80 = sub i32 %.028.lcssa, %.0.lcssa
  %81 = call i1 @_FortranAioOutputInteger32(ptr %79, i32 %80)
  %82 = call i32 @_FortranAioEndIoStatement(ptr %79)
  %83 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none)
define void @_QFPquick_sort(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 = trunc i64 %5 to i32
  %7 = add i32 %6, 1
  %8 = sdiv i32 %7, 2
  %narrow = add nsw i32 %8, -1
  %9 = sext i32 %narrow to i64
  %10 = load ptr, ptr %0, align 8, !tbaa !7
  %11 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %12 = load i64, ptr %11, align 8, !tbaa !7
  %13 = mul i64 %12, %9
  %14 = getelementptr i8, ptr %10, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !3
  %16 = load i32, ptr %10, align 4, !tbaa !3
  %sext = shl i64 %5, 32
  %17 = ashr exact i64 %sext, 32
  %18 = add nsw i64 %17, -1
  %19 = mul i64 %18, %12
  %20 = getelementptr i8, ptr %10, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !3
  %22 = tail call i32 @llvm.smax.i32(i32 %15, i32 %16)
  %23 = tail call i32 @llvm.smax.i32(i32 %22, i32 %21)
  %24 = tail call i32 @llvm.smin.i32(i32 %15, i32 %16)
  %25 = tail call i32 @llvm.smin.i32(i32 %24, i32 %21)
  %.neg48 = add i32 %16, %15
  %26 = add i32 %.neg48, %21
  %27 = add i32 %25, %23
  %28 = sub i32 %26, %27
  br label %.outer

.outer:                                           ; preds = %66, %1
  %.044.ph = phi i32 [ %36, %66 ], [ 1, %1 ]
  %.0.ph = phi i32 [ %45, %66 ], [ %6, %1 ]
  br label %29

29:                                               ; preds = %29, %.outer
  %.044 = phi i32 [ %36, %29 ], [ %.044.ph, %.outer ]
  %30 = sext i32 %.044 to i64
  %31 = add nsw i64 %30, -1
  %32 = mul i64 %31, %12
  %33 = getelementptr i8, ptr %10, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !3
  %35 = icmp slt i32 %34, %28
  %36 = add i32 %.044, 1
  br i1 %35, label %29, label %.preheader

.preheader:                                       ; preds = %29
  %37 = getelementptr i8, ptr %10, i64 %32
  br label %38

38:                                               ; preds = %38, %.preheader
  %.1 = phi i32 [ %45, %38 ], [ %.0.ph, %.preheader ]
  %39 = sext i32 %.1 to i64
  %40 = add nsw i64 %39, -1
  %41 = mul i64 %40, %12
  %42 = getelementptr i8, ptr %10, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !3
  %44 = icmp sgt i32 %43, %28
  %45 = add i32 %.1, -1
  br i1 %44, label %38, label %46

46:                                               ; preds = %38
  %.not = icmp slt i32 %.044, %.1
  br i1 %.not, label %66, label %47

47:                                               ; preds = %46
  %48 = icmp sgt i32 %.044, 2
  br i1 %48, label %49, label %52

49:                                               ; preds = %47
  %50 = add nsw i32 %.044, -1
  %51 = zext i32 %50 to i64
  store ptr %10, ptr %2, align 8, !tbaa !7
  %.fca.1.gep27 = 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.gep27, align 8, !tbaa !7
  %.fca.2.gep29 = 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.gep29, align 8, !tbaa !7
  %.fca.3.gep31 = 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.gep31, align 4, !tbaa !7
  %.fca.4.gep33 = 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.gep33, align 1, !tbaa !7
  %.fca.5.gep35 = 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.gep35, align 2, !tbaa !7
  %.fca.6.gep37 = 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.gep37, align 1, !tbaa !7
  %.fca.7.0.0.gep39 = 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.gep39, align 8, !tbaa !7
  %.fca.7.0.1.gep41 = 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 %51, ptr %.fca.7.0.1.gep41, align 8, !tbaa !7
  %.fca.7.0.2.gep43 = 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 %12, ptr %.fca.7.0.2.gep43, align 8, !tbaa !7
  call void @_QFPquick_sort(ptr nonnull %2)
  br label %52

52:                                               ; preds = %49, %47
  %53 = add i32 %.1, 1
  %54 = icmp slt i32 %53, %6
  br i1 %54, label %55, label %65

55:                                               ; preds = %52
  %56 = sext i32 %53 to i64
  %57 = load i64, ptr %11, align 8, !tbaa !7
  %58 = load ptr, ptr %0, align 8, !tbaa !7
  %59 = add nsw i64 %56, -1
  %60 = mul i64 %57, %59
  %61 = getelementptr i8, ptr %58, i64 %60
  %62 = sub nsw i64 %17, %56
  %63 = tail call i64 @llvm.smax.i64(i64 %62, i64 -1)
  %64 = add nsw i64 %63, 1
  store ptr %61, ptr %3, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep, align 8, !tbaa !7
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  store i8 1, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  store i8 9, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %.fca.7.0.0.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 0
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  %.fca.7.0.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 7, i64 0, i64 1
  store i64 %64, 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 %57, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  call void @_QFPquick_sort(ptr nonnull %3)
  br label %65

65:                                               ; preds = %55, %52
  ret void

66:                                               ; preds = %46
  %67 = getelementptr i8, ptr %10, i64 %41
  store i32 %43, ptr %37, align 4, !tbaa !3
  store i32 %34, ptr %67, align 4, !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 i1 @_FortranAioInputDescriptor(ptr, ptr) 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

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

attributes #0 = { noreturn }
attributes #1 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(none) }

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

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