PROGRAM ATCODER

implicit none
integer :: n,k,i
character(len=10) :: s
character(len=1) :: c

read*, n,s,k

c = s(k:k)

do i = 1, len_trim(s)
  if ( s(i:i) /= c ) then
    s(i:i) = '*'
  end if
end do

print'(a)', trim(s) 

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"

@_QQcl.7cc3aa6197e058ee9dfc1dddc4cdc350 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4428/source.f\00"
@_QQcl.2A = linkonce local_unnamed_addr constant [1 x i8] c"*"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_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 [1 x i8], align 1
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [10 x i8], align 1
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.7cc3aa6197e058ee9dfc1dddc4cdc350, i32 8)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %5, i32 4)
  %9 = call i1 @_FortranAioInputAscii(ptr %7, ptr nonnull %6, i64 10)
  %10 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %4, i32 4)
  %11 = call i32 @_FortranAioEndIoStatement(ptr %7)
  %12 = load i32, ptr %4, align 4, !tbaa !3
  %13 = sext i32 %12 to i64
  %14 = add nsw i64 %13, -1
  %15 = getelementptr [10 x [1 x i8]], ptr %6, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1
  store i8 %16, ptr %3, align 1
  br label %17

17:                                               ; preds = %0, %17
  %18 = phi i64 [ 9, %0 ], [ %22, %17 ]
  %19 = getelementptr [10 x [1 x i8]], ptr %6, i64 0, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !3
  %21 = icmp eq i8 %20, 32
  %22 = add nsw i64 %18, -1
  %23 = icmp ne i64 %18, 0
  %24 = and i1 %21, %23
  br i1 %24, label %17, label %25

25:                                               ; preds = %17
  %26 = shl i64 %18, 32
  %sext = add i64 %26, 4294967296
  %27 = ashr exact i64 %sext, 32
  %spec.select = select i1 %21, i64 0, i64 %27
  %28 = icmp sgt i64 %spec.select, 0
  br i1 %28, label %.lr.ph, label %select.unfold._crit_edge

.lr.ph:                                           ; preds = %25
  %29 = load i8, ptr @_QQcl.2A, align 1
  br label %30

30:                                               ; preds = %.lr.ph, %select.unfold
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %select.unfold ]
  %31 = add nsw i64 %indvars.iv, -1
  %32 = getelementptr [10 x [1 x i8]], ptr %6, i64 0, i64 %31
  %33 = call i32 @_FortranACharacterCompareScalar1(ptr %32, ptr nonnull %3, i64 1, i64 1)
  %.not = icmp eq i32 %33, 0
  br i1 %.not, label %select.unfold, label %34

34:                                               ; preds = %30
  store i8 %29, ptr %32, align 1
  br label %select.unfold

select.unfold:                                    ; preds = %34, %30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %spec.select
  br i1 %exitcond.not, label %select.unfold._crit_edge, label %30

select.unfold._crit_edge:                         ; preds = %select.unfold, %25
  %35 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.7cc3aa6197e058ee9dfc1dddc4cdc350, i32 18)
  store ptr %6, ptr %1, align 8, !tbaa !7
  %.fca.1.gep15 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 10, ptr %.fca.1.gep15, align 8, !tbaa !7
  %.fca.2.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep17, align 8, !tbaa !7
  %.fca.3.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep19, align 4, !tbaa !7
  %.fca.4.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep21, align 1, !tbaa !7
  %.fca.5.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep23, align 2, !tbaa !7
  %.fca.6.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep25, align 1, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, 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 }, ptr %2, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %36 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.7cc3aa6197e058ee9dfc1dddc4cdc350, i32 18)
  %.fca.0.load = load ptr, ptr %2, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %37 = call i1 @_FortranAioOutputAscii(ptr %35, ptr %.fca.0.load, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load)
  %38 = call i32 @_FortranAioEndIoStatement(ptr %35)
  ret void
}

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

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

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

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