character(10**5) S
character LastS
integer K
read*,S
read*,K

do i=1,len_trim(S)-1
  if(S(i:i)/="a".and.ichar("z")+1-ichar(S(i:i))<=K)then
    K=K-(ichar("z")+1-ichar(S(i:i)))
    S(i:i)="a"
  endif
end do
LastS=S(len_trim(S):len_trim(S))
S(len_trim(S):len_trim(S))=char(ichar("a")+mod(ichar(LastS)-ichar("a")+K,26) )

print"(A)",trim(S)
end
; 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 = internal global [100000 x i8] undef
@_QQcl.c3a4d65b6bdd49f4cd831f62235c349e = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7870/source.f\00"
@_QQcl.61 = linkonce constant [1 x i8] c"a"
@_QQcl.284129 = 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
  %.sroa.0 = alloca i8, align 1
  %3 = alloca i32, align 4
  %.sroa.073 = alloca i8, align 1
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c3a4d65b6bdd49f4cd831f62235c349e, i32 4)
  %5 = tail call i1 @_FortranAioInputAscii(ptr %4, ptr nonnull @_QFEs, i64 100000)
  %6 = tail call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c3a4d65b6bdd49f4cd831f62235c349e, i32 5)
  %8 = call i1 @_FortranAioInputInteger(ptr %7, ptr nonnull %3, i32 4)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %7)
  br label %10

10:                                               ; preds = %0, %10
  %11 = phi i64 [ 99999, %0 ], [ %15, %10 ]
  %12 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !3
  %14 = icmp eq i8 %13, 32
  %15 = add nsw i64 %11, -1
  %16 = icmp ne i64 %11, 0
  %17 = and i1 %14, %16
  br i1 %17, label %10, label %18

18:                                               ; preds = %10
  %sext = shl i64 %11, 32
  %19 = ashr exact i64 %sext, 32
  %spec.select = select i1 %14, i64 -1, i64 %19
  %20 = icmp sgt i64 %spec.select, 0
  br i1 %20, label %.lr.ph, label %.preheader75.preheader

.lr.ph:                                           ; preds = %18
  %21 = load i8, ptr @_QQcl.61, align 1
  br label %22

22:                                               ; preds = %.lr.ph, %select.unfold
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %select.unfold ]
  %23 = add nsw i64 %indvars.iv, -1
  %24 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %23
  %25 = call i32 @_FortranACharacterCompareScalar1(ptr %24, ptr nonnull @_QQcl.61, i64 1, i64 1)
  %26 = icmp ne i32 %25, 0
  %.unpack = load i8, ptr %24, align 1, !tbaa !3
  %27 = zext i8 %.unpack to i32
  %28 = sub nsw i32 123, %27
  %29 = load i32, ptr %3, align 4, !tbaa !3
  %30 = icmp sge i32 %29, %28
  %31 = and i1 %26, %30
  br i1 %31, label %32, label %select.unfold

32:                                               ; preds = %22
  %33 = sub i32 %29, %28
  store i32 %33, ptr %3, align 4, !tbaa !3
  store i8 %21, ptr %24, align 1
  br label %select.unfold

select.unfold:                                    ; preds = %32, %22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %spec.select
  br i1 %exitcond.not, label %.preheader75.preheader, label %22

.preheader75.preheader:                           ; preds = %select.unfold, %18
  br label %.preheader75

.preheader75:                                     ; preds = %.preheader75.preheader, %.preheader75
  %34 = phi i64 [ %38, %.preheader75 ], [ 99999, %.preheader75.preheader ]
  %35 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !3
  %37 = icmp eq i8 %36, 32
  %38 = add nsw i64 %34, -1
  %39 = icmp ne i64 %34, 0
  %40 = and i1 %37, %39
  br i1 %40, label %.preheader75, label %.preheader74

.preheader74:                                     ; preds = %.preheader75, %.preheader74
  %41 = phi i64 [ %45, %.preheader74 ], [ 99999, %.preheader75 ]
  %42 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !3
  %44 = icmp eq i8 %43, 32
  %45 = add nsw i64 %41, -1
  %46 = icmp ne i64 %41, 0
  %47 = and i1 %44, %46
  br i1 %47, label %.preheader74, label %.peel.begin

.peel.begin:                                      ; preds = %.preheader74
  %48 = shl i64 %34, 32
  %sext69 = add i64 %48, 4294967296
  %49 = ashr exact i64 %sext69, 32
  %50 = select i1 %37, i64 0, i64 %49
  %51 = shl i64 %41, 32
  %sext70 = add i64 %51, 4294967296
  %52 = ashr exact i64 %sext70, 32
  %53 = select i1 %44, i64 0, i64 %52
  %54 = add nsw i64 %50, -1
  %55 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %54
  %56 = icmp sge i64 %53, %50
  %57 = zext i1 %56 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %.sroa.073, ptr align 1 %55, i64 %57, i1 false)
  %.sroa.073.0..sroa.073.0..sroa.073.promoted = load i8, ptr %.sroa.073, align 1, !tbaa !3
  %58 = zext i8 %.sroa.073.0..sroa.073.0..sroa.073.promoted to i32
  %.op = add nsw i32 %58, -97
  %59 = select i1 %56, i32 %.op, i32 -65
  %60 = load i32, ptr %3, align 4, !tbaa !3
  %61 = add i32 %59, %60
  %62 = srem i32 %61, 26
  %63 = trunc i32 %62 to i8
  %64 = add nsw i8 %63, 97
  store i8 %64, ptr %.sroa.0, align 1, !tbaa !3
  br label %65

65:                                               ; preds = %.peel.begin, %65
  %66 = phi i64 [ 99999, %.peel.begin ], [ %70, %65 ]
  %67 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !3
  %69 = icmp eq i8 %68, 32
  %70 = add nsw i64 %66, -1
  %71 = icmp ne i64 %66, 0
  %72 = and i1 %69, %71
  br i1 %72, label %65, label %.preheader

.preheader:                                       ; preds = %65, %.preheader
  %73 = phi i64 [ %77, %.preheader ], [ 99999, %65 ]
  %74 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !3
  %76 = icmp eq i8 %75, 32
  %77 = add nsw i64 %73, -1
  %78 = icmp ne i64 %73, 0
  %79 = and i1 %76, %78
  br i1 %79, label %.preheader, label %80

80:                                               ; preds = %.preheader
  %81 = shl i64 %66, 32
  %sext71 = add i64 %81, 4294967296
  %82 = ashr exact i64 %sext71, 32
  %83 = select i1 %69, i64 0, i64 %82
  %84 = shl i64 %73, 32
  %sext72 = add i64 %84, 4294967296
  %85 = ashr exact i64 %sext72, 32
  %86 = select i1 %76, i64 0, i64 %85
  %87 = add nsw i64 %83, -1
  %88 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %87
  %89 = sub nsw i64 %86, %83
  %90 = call i64 @llvm.smax.i64(i64 %89, i64 -1)
  %91 = call i64 @llvm.smin.i64(i64 %90, i64 0)
  %92 = add nsw i64 %91, 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %88, ptr nonnull align 1 %.sroa.0, i64 %92, i1 false)
  %93 = sub nsw i64 %90, %91
  %94 = icmp sgt i64 %93, 0
  br i1 %94, label %.lr.ph86.preheader, label %._crit_edge

.lr.ph86.preheader:                               ; preds = %80
  %95 = add nsw i64 %83, %91
  %uglygep = getelementptr i8, ptr @_QFEs, i64 %95
  call void @llvm.memset.p0.i64(ptr align 1 %uglygep, i8 32, i64 %93, i1 false), !tbaa !3
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph86.preheader, %80
  %96 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.c3a4d65b6bdd49f4cd831f62235c349e, i32 16)
  store ptr @_QFEs, ptr %1, align 8, !tbaa !7
  %.fca.1.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 100000, ptr %.fca.1.gep19, align 8, !tbaa !7
  %.fca.2.gep20 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep20, align 8, !tbaa !7
  %.fca.3.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep21, align 4, !tbaa !7
  %.fca.4.gep22 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep22, 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.gep24 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep24, 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
  %97 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.c3a4d65b6bdd49f4cd831f62235c349e, i32 16)
  %.fca.0.load10 = load ptr, ptr %2, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %98 = call i1 @_FortranAioOutputAscii(ptr %96, ptr %.fca.0.load10, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load10)
  %99 = call i32 @_FortranAioEndIoStatement(ptr %96)
  ret void
}

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

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

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) 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 nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #1

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

; 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) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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}
