program main
 implicit none

 integer N,K,i
 character*80 S,e
 read(*,*) N,S,K
 e(1:1) = S(K:K)
 do i=1,N
  if(S(i:i) /= e(1:1)) then
   S(i:i) = '*'
  end if
 end do

 write(*,*) S   
end program main
; 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"

@_QFEe = internal global [80 x i8] undef
@_QFEs = internal global [80 x i8] undef
@_QQcl.ca6c80302e791bb95541ab1fb4340e19 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4427/source.f\00"
@_QQcl.2A = linkonce local_unnamed_addr constant [1 x i8] c"*"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.ca6c80302e791bb95541ab1fb4340e19, i32 6)
  %4 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %2, i32 4)
  %5 = call i1 @_FortranAioInputAscii(ptr %3, ptr nonnull @_QFEs, i64 80)
  %6 = call i1 @_FortranAioInputInteger(ptr %3, ptr nonnull %1, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %3)
  %8 = load i32, ptr %1, align 4, !tbaa !3
  %9 = sext i32 %8 to i64
  %10 = add nsw i64 %9, -1
  %11 = getelementptr [80 x [1 x i8]], ptr @_QFEs, i64 0, i64 %10
  %12 = load i8, ptr %11, align 1
  store i8 %12, ptr @_QFEe, align 16
  %13 = load i32, ptr %2, align 4, !tbaa !3
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %15 = zext i32 %13 to i64
  %16 = load i8, ptr @_QQcl.2A, align 1
  br label %17

17:                                               ; preds = %.lr.ph, %22
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %22 ]
  %18 = add nsw i64 %indvars.iv, -1
  %19 = getelementptr [80 x [1 x i8]], ptr @_QFEs, i64 0, i64 %18
  %20 = call i32 @_FortranACharacterCompareScalar1(ptr %19, ptr nonnull @_QFEe, i64 1, i64 1)
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %22, label %21

21:                                               ; preds = %17
  store i8 %16, ptr %19, align 1
  br label %22

22:                                               ; preds = %21, %17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %15
  br i1 %exitcond.not, label %._crit_edge, label %17

._crit_edge:                                      ; preds = %22, %0
  %23 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.ca6c80302e791bb95541ab1fb4340e19, i32 14)
  %24 = call i1 @_FortranAioOutputAscii(ptr %23, ptr nonnull @_QFEs, i64 80)
  %25 = call i32 @_FortranAioEndIoStatement(ptr %23)
  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 @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

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

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