program dubious_document
  implicit none
  integer       :: n, i, j, k, a(50,26)
  character(50) :: s
  a = 0
  read(*,*) n
  do i = 1, n
    read(*,*) s
    s = trim(adjustl(s))
    do j = 1, len_trim(s)
      k = ichar(s(j:j)) - 96
      a(i,k) = a(i,k) + 1
    end do
  end do
  do i = 1, 26
    k = minval(a(1:n,i))
    if (k.gt.0) then
      do j = 1, k
        write(*,'(a)',advance='no') achar(i+96)
      end do
    end if
  end do
  write(*,*)
end program dubious_document
; 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 [26 x [50 x i32]] undef
@_QFEs = internal global [50 x i8] undef
@_QQcl.ea3d5a35bd5193e67474f3663ef00884 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7400/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQcl.6E6F = linkonce constant [2 x i8] c"no"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, align 8
  %4 = alloca [1 x i8], align 1
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %7 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5200) @_QFEa, i8 0, i64 5200, i1 false), !tbaa !3
  %8 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 6)
  %9 = call i1 @_FortranAioInputInteger(ptr %8, ptr nonnull %7, i32 4)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  %11 = load i32, ptr %7, align 4, !tbaa !3
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph166, label %.preheader

.lr.ph166:                                        ; preds = %0
  %13 = zext i32 %11 to i64
  %.fca.1.gep70 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep71 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  %.fca.3.gep72 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  %.fca.4.gep73 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  %.fca.5.gep74 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  %.fca.6.gep75 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 6
  %.fca.1.gep136 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  %.fca.2.gep138 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  %.fca.3.gep140 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  %.fca.4.gep142 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  %.fca.5.gep144 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  %.fca.6.gep146 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  %.fca.1.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 1
  %.fca.2.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 2
  %.fca.3.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 3
  %.fca.4.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 4
  %.fca.5.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 5
  %.fca.6.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 6
  br label %14

.preheader:                                       ; preds = %select.unfold._crit_edge, %0
  %.fca.1.gep58 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 1
  %.fca.2.gep60 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 2
  %.fca.3.gep62 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 3
  %.fca.4.gep64 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 4
  %.fca.5.gep66 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 5
  %.fca.6.gep68 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, ptr %3, i64 0, i32 6
  %.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
  %.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
  %.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
  br label %57

14:                                               ; preds = %.lr.ph166, %select.unfold._crit_edge
  %indvars.iv169 = phi i64 [ 1, %.lr.ph166 ], [ %indvars.iv.next170, %select.unfold._crit_edge ]
  %15 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 8)
  %16 = call i1 @_FortranAioInputAscii(ptr %15, ptr nonnull @_QFEs, i64 50)
  %17 = call i32 @_FortranAioEndIoStatement(ptr %15)
  store ptr @_QFEs, ptr %2, align 8, !tbaa !7
  store i64 50, ptr %.fca.1.gep70, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep71, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep72, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep73, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep74, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep75, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %18 = call {} @_FortranAAdjustl(ptr nonnull %6, ptr nonnull %2, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 9)
  %.fca.0.load = load ptr, ptr %6, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  store ptr %.fca.0.load, ptr %1, align 8, !tbaa !7
  store i64 %.fca.1.load, ptr %.fca.1.gep136, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep138, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep140, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep142, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep144, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep146, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep23, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep25, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep27, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep29, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep31, align 1, !tbaa !7
  %19 = call {} @_FortranATrim(ptr nonnull %5, ptr nonnull %1, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 9)
  %.fca.0.load33 = load ptr, ptr %5, align 8, !tbaa !7
  %.fca.1.load36 = load i64, ptr %.fca.1.gep21, align 8, !tbaa !7
  %20 = call i64 @llvm.smin.i64(i64 %.fca.1.load36, i64 50)
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 16 @_QFEs, ptr align 1 %.fca.0.load33, i64 %20, i1 false)
  %21 = sub i64 50, %20
  %22 = icmp sgt i64 %21, 0
  br i1 %22, label %.lr.ph.preheader, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph.preheader, %14
  call void @free(ptr %.fca.0.load33)
  call void @free(ptr %.fca.0.load)
  br label %23

23:                                               ; preds = %._crit_edge, %23
  %24 = phi i64 [ 49, %._crit_edge ], [ %28, %23 ]
  %25 = getelementptr [50 x [1 x i8]], ptr @_QFEs, i64 0, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !3
  %27 = icmp eq i8 %26, 32
  %28 = add nsw i64 %24, -1
  %29 = icmp ne i64 %24, 0
  %30 = and i1 %27, %29
  br i1 %30, label %23, label %31

31:                                               ; preds = %23
  %32 = shl i64 %24, 32
  %sext = add i64 %32, 4294967296
  %33 = ashr exact i64 %sext, 32
  %spec.select = select i1 %27, i64 0, i64 %33
  %34 = icmp sgt i64 %spec.select, 0
  br i1 %34, label %.lr.ph164, label %select.unfold._crit_edge

.lr.ph164:                                        ; preds = %31
  %35 = add nsw i64 %indvars.iv169, -1
  %xtraiter = and i64 %spec.select, 1
  %36 = icmp eq i64 %spec.select, 1
  br i1 %36, label %select.unfold._crit_edge.loopexit.unr-lcssa, label %.lr.ph164.new

.lr.ph164.new:                                    ; preds = %.lr.ph164
  %unroll_iter = and i64 %spec.select, -2
  br label %select.unfold

select.unfold:                                    ; preds = %select.unfold, %.lr.ph164.new
  %indvars.iv = phi i64 [ 1, %.lr.ph164.new ], [ %indvars.iv.next.1, %select.unfold ]
  %niter = phi i64 [ 0, %.lr.ph164.new ], [ %niter.next.1, %select.unfold ]
  %37 = add nsw i64 %indvars.iv, -1
  %38 = getelementptr [50 x [1 x i8]], ptr @_QFEs, i64 0, i64 %37
  %.unpack = load i8, ptr %38, align 1, !tbaa !3
  %39 = zext i8 %.unpack to i64
  %40 = add nsw i64 %39, -97
  %41 = getelementptr [26 x [50 x i32]], ptr @_QFEa, i64 0, i64 %40, i64 %35
  %42 = load i32, ptr %41, align 4, !tbaa !3
  %43 = add i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !3
  %44 = getelementptr [50 x [1 x i8]], ptr @_QFEs, i64 0, i64 %indvars.iv
  %.unpack.1 = load i8, ptr %44, align 1, !tbaa !3
  %45 = zext i8 %.unpack.1 to i64
  %46 = add nsw i64 %45, -97
  %47 = getelementptr [26 x [50 x i32]], ptr @_QFEa, i64 0, i64 %46, i64 %35
  %48 = load i32, ptr %47, align 4, !tbaa !3
  %49 = add i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !3
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %select.unfold._crit_edge.loopexit.unr-lcssa, label %select.unfold

select.unfold._crit_edge.loopexit.unr-lcssa:      ; preds = %select.unfold, %.lr.ph164
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph164 ], [ %indvars.iv.next.1, %select.unfold ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %select.unfold._crit_edge, label %select.unfold.epil

select.unfold.epil:                               ; preds = %select.unfold._crit_edge.loopexit.unr-lcssa
  %50 = add nsw i64 %indvars.iv.unr, -1
  %51 = getelementptr [50 x [1 x i8]], ptr @_QFEs, i64 0, i64 %50
  %.unpack.epil = load i8, ptr %51, align 1, !tbaa !3
  %52 = zext i8 %.unpack.epil to i64
  %53 = add nsw i64 %52, -97
  %54 = getelementptr [26 x [50 x i32]], ptr @_QFEa, i64 0, i64 %53, i64 %35
  %55 = load i32, ptr %54, align 4, !tbaa !3
  %56 = add i32 %55, 1
  store i32 %56, ptr %54, align 4, !tbaa !3
  br label %select.unfold._crit_edge

select.unfold._crit_edge:                         ; preds = %select.unfold.epil, %select.unfold._crit_edge.loopexit.unr-lcssa, %31
  %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
  %exitcond172.not = icmp eq i64 %indvars.iv169, %13
  br i1 %exitcond172.not, label %.preheader, label %14

57:                                               ; preds = %.preheader, %.loopexit
  %indvars.iv173 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next174, %.loopexit ]
  %58 = load i32, ptr %7, align 4, !tbaa !3
  %59 = call i32 @llvm.smax.i32(i32 %58, i32 0)
  %60 = zext i32 %59 to i64
  %61 = add nsw i64 %indvars.iv173, -1
  %62 = getelementptr [26 x [50 x i32]], ptr @_QFEa, i64 0, i64 %61, i64 0
  store ptr %62, ptr %3, align 8, !tbaa !7
  store i64 4, ptr %.fca.1.gep58, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep60, align 8, !tbaa !7
  store i8 1, ptr %.fca.3.gep62, align 4, !tbaa !7
  store i8 9, ptr %.fca.4.gep64, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep66, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep68, align 1, !tbaa !7
  store i64 1, ptr %.fca.7.0.0.gep, align 8, !tbaa !7
  store i64 %60, ptr %.fca.7.0.1.gep, align 8, !tbaa !7
  store i64 4, ptr %.fca.7.0.2.gep, align 8, !tbaa !7
  %63 = call i32 @_FortranAMinvalInteger4(ptr nonnull %3, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 16, i32 0, ptr null)
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %65, label %.loopexit

65:                                               ; preds = %57
  %66 = zext i32 %63 to i64
  %67 = trunc i64 %indvars.iv173 to i8
  %68 = add i8 %67, 96
  br label %69

69:                                               ; preds = %65, %69
  %70 = phi i64 [ %66, %65 ], [ %75, %69 ]
  %71 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 19)
  %72 = call i1 @_FortranAioSetAdvance(ptr %71, ptr nonnull @_QQcl.6E6F, i64 2)
  store i8 %68, ptr %4, align 1, !tbaa !3
  %73 = call i1 @_FortranAioOutputAscii(ptr %71, ptr nonnull %4, i64 1)
  %74 = call i32 @_FortranAioEndIoStatement(ptr %71)
  %75 = add nsw i64 %70, -1
  %76 = icmp ugt i64 %70, 1
  br i1 %76, label %69, label %.loopexit

.loopexit:                                        ; preds = %69, %57
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %exitcond176.not = icmp eq i64 %indvars.iv.next174, 27
  br i1 %exitcond176.not, label %77, label %57

77:                                               ; preds = %.loopexit
  %78 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ea3d5a35bd5193e67474f3663ef00884, i32 23)
  %79 = call i32 @_FortranAioEndIoStatement(ptr %78)
  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 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

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

declare {} @_FortranATrim(ptr, ptr, ptr, i32) 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) #1

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

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

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

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

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

; 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 i64 @llvm.smin.i64(i64, i64) #2

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

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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}
