program kadai
implicit none
integer  ::  n
character(len=10),allocatable  ::  s(:)
character(len=10)  ::  hako
character(len=1)  ::  word(10)
integer  ::  i,j,k
integer(8)  ::  num
integer(8)  ::  ans

read(*,*) n

allocate(s(n))

do i=1,n
    read(*,*) s(i)
end do

do i=1,n
    hako=s(i)
    do j=1,10
        word(j)=hako(j:j)
    end do
    call qsort(word)
    do j=1,10
        hako(j:j)=word(j)
    end do
    s(i)=hako
end do


num=0
call qsort(s)

!do i=1,n
!   write(*,*) s(i)
!end do

i=1
num=0
ans=0
do while (i<n+1)
    j=i+1
    do while (j<n+1)
        if (s(i)==s(j)) then
            num=num+1
            j=j+1
        else
            exit
        end if
    end do
    ans=ans+(num+1)*(num)/2
    i=j
    num=0
end do

write(*,*) ans





stop
contains

subroutine swap(a,b)
implicit none
character(len=*),intent(inout)  ::  a,b
character(len=10)  ::  c
c=a
a=b
b=c
end subroutine swap

subroutine qsort(x)
implicit none
character(len=*), intent(inout)  ::  x(:)
integer  ::  first,last
first=1
last=size(x)
call q2sort(x,first,last)
return
end subroutine qsort

recursive subroutine q2sort(x,first,last)
implicit none
character(len=*), intent(inout)  ::  x(:)
integer, intent(inout) ::  first,last
integer  ::  fir, las
integer  ::  i,j
character(len=10)  ::  n
n=x((first+last)/2)
i=first
j=last
do
do while (x(i)<n)
i=i+1
end do
do while(x(j)>n)
j=j-1
end do
if (i>j .or. i==j) then
exit
end if
call swap(x(i),x(j))
i=i+1
j=j-1
end do
if (first<i-1) then
las=i-1
call q2sort(x,first,las)
end if
if (last>j+1) then
fir=j+1
call q2sort(x,fir,last)
end if
end subroutine q2sort


end program kadai

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

@_QFEs.0 = internal unnamed_addr global ptr null
@_QFEs.8 = internal unnamed_addr global i64 0
@_QQcl.583a9b517a41e5481b99d8af32b14b9c = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_3531/source.f\00"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %7 = alloca i32, align 4
  %8 = alloca [10 x [1 x i8]], align 1
  %9 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.583a9b517a41e5481b99d8af32b14b9c, i32 11)
  %10 = call i1 @_FortranAioInputInteger(ptr %9, ptr nonnull %7, i32 4)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %9)
  %12 = load i32, ptr %7, align 4, !tbaa !3
  %13 = call i32 @llvm.smax.i32(i32 %12, i32 0)
  %14 = zext i32 %13 to i64
  %15 = mul nuw nsw i64 %14, 10
  %16 = call ptr @malloc(i64 %15)
  store ptr %16, ptr @_QFEs.0, align 8, !tbaa !7
  store i64 %14, ptr @_QFEs.8, align 8, !tbaa !7
  %17 = icmp sgt i32 %12, 0
  br i1 %17, label %.lr.ph.preheader, label %._crit_edge.._crit_edge279_crit_edge

.lr.ph.preheader:                                 ; preds = %0
  %18 = zext i32 %12 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %19 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.583a9b517a41e5481b99d8af32b14b9c, i32 16)
  %.unpack265 = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr [10 x i8], ptr %.unpack265, i64 %20
  %22 = call i1 @_FortranAioInputAscii(ptr %19, ptr %21, i64 10)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %19)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %18
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph
  %.pre = load i32, ptr %7, align 4, !tbaa !3
  %24 = icmp sgt i32 %.pre, 0
  br i1 %24, label %.lr.ph278, label %._crit_edge.._crit_edge279_crit_edge

._crit_edge.._crit_edge279_crit_edge:             ; preds = %0, %._crit_edge
  %.unpack.pre = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  br label %._crit_edge279

.lr.ph278:                                        ; preds = %._crit_edge
  %25 = zext i32 %.pre to i64
  %.fca.1.gep124 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 1
  %.fca.2.gep126 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 2
  %.fca.3.gep128 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 3
  %.fca.4.gep130 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 4
  %.fca.5.gep132 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 5
  %.fca.6.gep134 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 6
  %.fca.7.0.0.gep136 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 0
  %.fca.7.0.1.gep138 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 1
  %.fca.7.0.2.gep140 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %5, i64 0, i32 7, i64 0, i64 2
  %.unpack241.pre = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  br label %26

26:                                               ; preds = %.lr.ph278, %26
  %.unpack241 = phi ptr [ %.unpack241.pre, %.lr.ph278 ], [ %.unpack253, %26 ]
  %indvars.iv300 = phi i64 [ 1, %.lr.ph278 ], [ %indvars.iv.next301, %26 ]
  %27 = add nsw i64 %indvars.iv300, -1
  %28 = getelementptr [10 x i8], ptr %.unpack241, i64 %27
  call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %8, ptr noundef nonnull align 1 dereferenceable(10) %28, i64 10, i1 false)
  store ptr %8, ptr %5, align 8, !tbaa !7
  store i64 1, ptr %.fca.1.gep124, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep126, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep128, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep130, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep132, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep134, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep136, align 8, !tbaa !7
  store i64 10, ptr %.fca.7.0.1.gep138, align 8, !tbaa !7
  store i64 1, ptr %.fca.7.0.2.gep140, align 8, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4)
  store i32 1, ptr %3, align 4, !tbaa !3
  store i32 10, ptr %4, align 4, !tbaa !3
  call void @_QFPq2sort(ptr nonnull %5, ptr nonnull %3, ptr nonnull %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4)
  %.unpack253 = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  %29 = add nsw i64 %indvars.iv300, -1
  %30 = getelementptr [10 x i8], ptr %.unpack253, i64 %29
  call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %30, ptr noundef nonnull align 1 dereferenceable(10) %8, i64 10, i1 false)
  %indvars.iv.next301 = add nuw nsw i64 %indvars.iv300, 1
  %exitcond303.not = icmp eq i64 %indvars.iv300, %25
  br i1 %exitcond303.not, label %._crit_edge279, label %26

._crit_edge279:                                   ; preds = %26, %._crit_edge.._crit_edge279_crit_edge
  %.unpack = phi ptr [ %.unpack.pre, %._crit_edge.._crit_edge279_crit_edge ], [ %.unpack253, %26 ]
  %.unpack224.unpack.unpack226 = load i64, ptr @_QFEs.8, align 8, !tbaa !7
  store ptr %.unpack, ptr %6, align 8, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %6, i64 0, i32 1
  store i64 10, 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 %6, 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 %6, 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 %6, i64 0, i32 4
  store i8 40, 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 %6, 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 %6, 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 %6, 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 %6, i64 0, i32 7, i64 0, i64 1
  store i64 %.unpack224.unpack.unpack226, 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 %6, i64 0, i32 7, i64 0, i64 2
  store i64 10, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2)
  store i32 1, ptr %1, align 4, !tbaa !3
  %31 = trunc i64 %.unpack224.unpack.unpack226 to i32
  store i32 %31, ptr %2, align 4, !tbaa !3
  call void @_QFPq2sort(ptr nonnull %6, ptr nonnull %1, ptr nonnull %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2)
  %32 = load i32, ptr %7, align 4, !tbaa !3
  %33 = add i32 %32, 1
  %34 = icmp sgt i32 %33, 1
  br i1 %34, label %.preheader, label %._crit_edge291

.preheader:                                       ; preds = %._crit_edge279, %._crit_edge284
  %35 = phi i32 [ %53, %._crit_edge284 ], [ %32, %._crit_edge279 ]
  %.0202290 = phi i32 [ %.0201.lcssa, %._crit_edge284 ], [ 1, %._crit_edge279 ]
  %.0203289 = phi i64 [ %57, %._crit_edge284 ], [ 0, %._crit_edge279 ]
  %.0201280 = add nsw i32 %.0202290, 1
  %36 = add i32 %35, 1
  %37 = icmp slt i32 %.0201280, %36
  br i1 %37, label %.lr.ph283, label %._crit_edge284

.lr.ph283:                                        ; preds = %.preheader
  %38 = sext i32 %.0202290 to i64
  %39 = sext i32 %.0201280 to i64
  %40 = add nsw i64 %38, -1
  br label %41

41:                                               ; preds = %.lr.ph283, %49
  %indvars.iv304 = phi i64 [ %39, %.lr.ph283 ], [ %indvars.iv.next305, %49 ]
  %.1281 = phi i64 [ 0, %.lr.ph283 ], [ %50, %49 ]
  %.unpack229 = load ptr, ptr @_QFEs.0, align 8, !tbaa !7
  %42 = getelementptr [10 x i8], ptr %.unpack229, i64 %40
  %43 = add i64 %indvars.iv304, -1
  %44 = getelementptr [10 x i8], ptr %.unpack229, i64 %43
  %45 = call i32 @_FortranACharacterCompareScalar1(ptr %42, ptr %44, i64 10, i64 10)
  %46 = icmp eq i32 %45, 0
  %47 = load i32, ptr %7, align 4, !tbaa !3
  %48 = add i32 %47, 1
  br i1 %46, label %49, label %._crit_edge284.loopexit

49:                                               ; preds = %41
  %50 = add nuw nsw i64 %.1281, 1
  %indvars.iv.next305 = add nsw i64 %indvars.iv304, 1
  %51 = sext i32 %48 to i64
  %52 = icmp slt i64 %indvars.iv.next305, %51
  br i1 %52, label %41, label %._crit_edge284.loopexit

._crit_edge284.loopexit:                          ; preds = %49, %41
  %.1.lcssa.ph = phi i64 [ %.1281, %41 ], [ %50, %49 ]
  %.0201.lcssa.ph.in = phi i64 [ %indvars.iv304, %41 ], [ %indvars.iv.next305, %49 ]
  %.0201.lcssa.ph = trunc i64 %.0201.lcssa.ph.in to i32
  br label %._crit_edge284

._crit_edge284:                                   ; preds = %._crit_edge284.loopexit, %.preheader
  %.pre-phi = phi i32 [ %48, %._crit_edge284.loopexit ], [ %36, %.preheader ]
  %53 = phi i32 [ %47, %._crit_edge284.loopexit ], [ %35, %.preheader ]
  %.1.lcssa = phi i64 [ %.1.lcssa.ph, %._crit_edge284.loopexit ], [ 0, %.preheader ]
  %.0201.lcssa = phi i32 [ %.0201.lcssa.ph, %._crit_edge284.loopexit ], [ %.0201280, %.preheader ]
  %54 = add i64 %.1.lcssa, 1
  %55 = mul i64 %54, %.1.lcssa
  %56 = sdiv i64 %55, 2
  %57 = add i64 %56, %.0203289
  %58 = icmp slt i32 %.0201.lcssa, %.pre-phi
  br i1 %58, label %.preheader, label %._crit_edge291

._crit_edge291:                                   ; preds = %._crit_edge284, %._crit_edge279
  %.0203.lcssa = phi i64 [ 0, %._crit_edge279 ], [ %57, %._crit_edge284 ]
  %59 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.583a9b517a41e5481b99d8af32b14b9c, i32 57)
  %60 = call i1 @_FortranAioOutputInteger64(ptr %59, i64 %.0203.lcssa)
  %61 = call i32 @_FortranAioEndIoStatement(ptr %59)
  %62 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

; Function Attrs: nofree nosync nounwind memory(argmem: readwrite)
define void @_QFPswap(ptr nocapture %0, ptr nocapture %1, i64 %2, i64 %3) local_unnamed_addr #2 {
  %5 = alloca [10 x i8], align 1
  %6 = tail call i64 @llvm.smin.i64(i64 %2, i64 10)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %5, ptr align 1 %0, i64 %6, i1 false)
  %7 = sub i64 10, %6
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %4
  %uglygep = getelementptr i8, ptr %5, i64 %6
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep, i8 32, i64 %7, i1 false), !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %4
  %9 = tail call i64 @llvm.smin.i64(i64 %2, i64 %3)
  tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %0, ptr align 1 %1, i64 %9, i1 false)
  %10 = sub i64 %2, %9
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph4.preheader, label %._crit_edge5

.lr.ph4.preheader:                                ; preds = %._crit_edge
  %uglygep9 = getelementptr i8, ptr %0, i64 %9
  tail call void @llvm.memset.p0.i64(ptr align 1 %uglygep9, i8 32, i64 %10, i1 false), !tbaa !3
  br label %._crit_edge5

._crit_edge5:                                     ; preds = %.lr.ph4.preheader, %._crit_edge
  %12 = tail call i64 @llvm.smin.i64(i64 %3, i64 10)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %1, ptr nonnull align 1 %5, i64 %12, i1 false)
  %13 = sub i64 %3, %12
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph7.preheader, label %._crit_edge8

.lr.ph7.preheader:                                ; preds = %._crit_edge5
  %uglygep10 = getelementptr i8, ptr %1, i64 %12
  tail call void @llvm.memset.p0.i64(ptr align 1 %uglygep10, i8 32, i64 %13, i1 false), !tbaa !3
  br label %._crit_edge8

._crit_edge8:                                     ; preds = %.lr.ph7.preheader, %._crit_edge5
  ret void
}

define void @_QFPqsort(ptr %0) local_unnamed_addr {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  store i32 1, ptr %2, align 4, !tbaa !3
  %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
  store i32 %6, ptr %3, align 4, !tbaa !3
  call void @_QFPq2sort(ptr %0, ptr nonnull %2, ptr nonnull %3)
  ret void
}

define void @_QFPq2sort(ptr %0, ptr nocapture readonly %1, ptr nocapture readonly %2) local_unnamed_addr {
  %4 = alloca [10 x i8], align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [10 x i8], align 1
  %8 = load i32, ptr %1, align 4, !tbaa !3
  %9 = load i32, ptr %2, align 4, !tbaa !3
  %10 = add i32 %9, %8
  %11 = sdiv i32 %10, 2
  %narrow = add nsw i32 %11, -1
  %12 = sext i32 %narrow to i64
  %13 = load ptr, ptr %0, align 8, !tbaa !7
  %14 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 7, i64 0, i64 2
  %15 = load i64, ptr %14, align 8, !tbaa !7
  %16 = mul i64 %15, %12
  %17 = getelementptr i8, ptr %13, i64 %16
  %18 = getelementptr { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %0, i64 0, i32 1
  %19 = load i64, ptr %18, align 8, !tbaa !7
  %20 = tail call i64 @llvm.smin.i64(i64 %19, i64 10)
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %7, ptr align 1 %17, i64 %20, i1 false)
  %21 = sub i64 10, %20
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph.preheader, label %.preheader18

.lr.ph.preheader:                                 ; preds = %3
  %uglygep = getelementptr i8, ptr %7, i64 %20
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep, i8 32, i64 %21, i1 false), !tbaa !3
  br label %.preheader18

.preheader18:                                     ; preds = %.lr.ph.preheader, %3
  %uglygep.i = getelementptr i8, ptr %4, i64 %20
  %23 = sub i64 %19, %20
  %24 = icmp sgt i64 %23, 0
  br label %.outer

25:                                               ; preds = %25, %.outer
  %.014 = phi i32 [ %34, %25 ], [ %.014.ph, %.outer ]
  %26 = sext i32 %.014 to i64
  %27 = add nsw i64 %26, -1
  %28 = load ptr, ptr %0, align 8, !tbaa !7
  %29 = load i64, ptr %14, align 8, !tbaa !7
  %30 = mul i64 %29, %27
  %31 = getelementptr i8, ptr %28, i64 %30
  %32 = call i32 @_FortranACharacterCompareScalar1(ptr %31, ptr nonnull %7, i64 %19, i64 10)
  %33 = icmp slt i32 %32, 0
  %34 = add i32 %.014, 1
  br i1 %33, label %25, label %.preheader

.preheader:                                       ; preds = %25, %.preheader
  %.1 = phi i32 [ %43, %.preheader ], [ %.0.ph, %25 ]
  %35 = sext i32 %.1 to i64
  %36 = add nsw i64 %35, -1
  %37 = load ptr, ptr %0, align 8, !tbaa !7
  %38 = load i64, ptr %14, align 8, !tbaa !7
  %39 = mul i64 %36, %38
  %40 = getelementptr i8, ptr %37, i64 %39
  %41 = call i32 @_FortranACharacterCompareScalar1(ptr %40, ptr nonnull %7, i64 %19, i64 10)
  %42 = icmp sgt i32 %41, 0
  %43 = add i32 %.1, -1
  br i1 %42, label %.preheader, label %44

44:                                               ; preds = %.preheader
  %.not = icmp slt i32 %.014, %.1
  br i1 %.not, label %56, label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %1, align 4, !tbaa !3
  %47 = add i32 %.014, -1
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  store i32 %47, ptr %6, align 4, !tbaa !3
  call void @_QFPq2sort(ptr nonnull %0, ptr nonnull %1, ptr nonnull %6)
  br label %50

50:                                               ; preds = %49, %45
  %51 = load i32, ptr %2, align 4, !tbaa !3
  %52 = add i32 %.1, 1
  %53 = icmp sgt i32 %51, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  store i32 %52, ptr %5, align 4, !tbaa !3
  call void @_QFPq2sort(ptr nonnull %0, ptr nonnull %5, ptr nonnull %2)
  br label %55

55:                                               ; preds = %54, %50
  ret void

56:                                               ; preds = %44
  %57 = load ptr, ptr %0, align 8, !tbaa !7
  %58 = load i64, ptr %14, align 8, !tbaa !7
  %59 = mul i64 %58, %27
  %60 = getelementptr i8, ptr %57, i64 %59
  %61 = mul i64 %58, %36
  %62 = getelementptr i8, ptr %57, i64 %61
  call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %4)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %4, ptr align 1 %60, i64 %20, i1 false)
  br i1 %22, label %.lr.ph.preheader.i, label %._crit_edge.i

.lr.ph.preheader.i:                               ; preds = %56
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep.i, i8 32, i64 %21, i1 false), !tbaa !3
  br label %._crit_edge.i

._crit_edge.i:                                    ; preds = %.lr.ph.preheader.i, %56
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %60, ptr align 1 %62, i64 %19, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %62, ptr nonnull align 1 %4, i64 %20, i1 false)
  br i1 %24, label %.lr.ph7.preheader.i, label %_QFPswap.exit

.lr.ph7.preheader.i:                              ; preds = %._crit_edge.i
  %uglygep10.i = getelementptr i8, ptr %62, i64 %20
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep10.i, i8 32, i64 %23, i1 false), !tbaa !3
  br label %_QFPswap.exit

_QFPswap.exit:                                    ; preds = %._crit_edge.i, %.lr.ph7.preheader.i
  call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %4)
  br label %.outer

.outer:                                           ; preds = %.preheader18, %_QFPswap.exit
  %.014.ph = phi i32 [ %8, %.preheader18 ], [ %34, %_QFPswap.exit ]
  %.0.ph = phi i32 [ %9, %.preheader18 ], [ %43, %_QFPswap.exit ]
  br label %25
}

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 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

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

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

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

declare i1 @_FortranAioOutputInteger64(ptr, i64) local_unnamed_addr

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; 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) #6

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #7

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #7

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { noreturn }
attributes #2 = { nofree nosync nounwind memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }

!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}
