PROGRAM ATCODER

implicit none
integer :: h,w,i,j
character(len=100),allocatable :: c(:)

read(*,*) h,w
allocate(c(h))

do i = 1, h
  read(*,*) c(i)
  write(*,'(a)') trim(c(i))
  write(*,'(a)') trim(c(i))
end do

contains
!!!!!! サブルーチンは↓
!!!!!!

END PROGRAM ATCODER
; 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"

@_QFEc.0 = internal unnamed_addr global ptr null
@_QQcl.b2aa78371376ad02320a5178e5bceab6 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7669/source.f\00"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_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

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 }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 7)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %5, i32 4)
  %9 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %6, i32 4)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %11 = load i32, ptr %5, align 4, !tbaa !3
  %12 = call i32 @llvm.smax.i32(i32 %11, i32 0)
  %13 = zext i32 %12 to i64
  %14 = mul nuw nsw i64 %13, 100
  %15 = call ptr @malloc(i64 %14)
  store ptr %15, ptr @_QFEc.0, align 8, !tbaa !7
  %16 = icmp sgt i32 %11, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %17 = zext i32 %11 to i64
  %.fca.1.gep138 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep140 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  %.fca.3.gep142 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  %.fca.4.gep144 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  %.fca.5.gep146 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  %.fca.6.gep148 = 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 %4, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 2
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  %.fca.1.gep246 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  %.fca.2.gep248 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  %.fca.3.gep250 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  %.fca.4.gep252 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  %.fca.5.gep254 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  %.fca.6.gep256 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  %.fca.1.gep14 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  %.fca.2.gep16 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  %.fca.3.gep18 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  %.fca.4.gep20 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  %.fca.5.gep22 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  %.fca.6.gep24 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  br label %18

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %18 ]
  %19 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 11)
  %.unpack = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %20 = add nsw i64 %indvars.iv, -1
  %21 = getelementptr [100 x i8], ptr %.unpack, i64 %20
  %22 = call i1 @_FortranAioInputAscii(ptr %19, ptr %21, i64 100)
  %23 = call i32 @_FortranAioEndIoStatement(ptr %19)
  %24 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 12)
  %.unpack284 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %25 = add nsw i64 %indvars.iv, -1
  %26 = getelementptr [100 x i8], ptr %.unpack284, i64 %25
  store ptr %26, ptr %2, align 8, !tbaa !7
  store i64 100, ptr %.fca.1.gep138, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep140, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep142, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep144, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep146, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep148, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, 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
  %27 = call {} @_FortranATrim(ptr nonnull %4, ptr nonnull %2, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 12)
  %.fca.0.load = load ptr, ptr %4, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %28 = call i1 @_FortranAioOutputAscii(ptr %24, ptr %.fca.0.load, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load)
  %29 = call i32 @_FortranAioEndIoStatement(ptr %24)
  %30 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 13)
  %.unpack296 = load ptr, ptr @_QFEc.0, align 8, !tbaa !7
  %31 = add nsw i64 %indvars.iv, -1
  %32 = getelementptr [100 x i8], ptr %.unpack296, i64 %31
  store ptr %32, ptr %1, align 8, !tbaa !7
  store i64 100, ptr %.fca.1.gep246, align 8, !tbaa !7
  store i32 20180515, ptr %.fca.2.gep248, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep250, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep252, align 1, !tbaa !7
  store i8 0, ptr %.fca.5.gep254, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep256, align 1, !tbaa !7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep16, align 8, !tbaa !7
  store i8 0, ptr %.fca.3.gep18, align 4, !tbaa !7
  store i8 40, ptr %.fca.4.gep20, align 1, !tbaa !7
  store i8 2, ptr %.fca.5.gep22, align 2, !tbaa !7
  store i8 0, ptr %.fca.6.gep24, align 1, !tbaa !7
  %33 = call {} @_FortranATrim(ptr nonnull %3, ptr nonnull %1, ptr nonnull @_QQcl.b2aa78371376ad02320a5178e5bceab6, i32 13)
  %.fca.0.load26 = load ptr, ptr %3, align 8, !tbaa !7
  %.fca.1.load29 = load i64, ptr %.fca.1.gep14, align 8, !tbaa !7
  %34 = call i1 @_FortranAioOutputAscii(ptr %30, ptr %.fca.0.load26, i64 %.fca.1.load29)
  call void @free(ptr %.fca.0.load26)
  %35 = call i32 @_FortranAioEndIoStatement(ptr %30)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %17
  br i1 %exitcond.not, label %._crit_edge, label %18

._crit_edge:                                      ; preds = %18, %0
  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 ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

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

declare {} @_FortranATrim(ptr, ptr, 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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 = { 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}
