      PROGRAM ROT_N
      IMPLICIT NONE
      integer(16) :: n
      character(10**4) :: s
      integer(16) :: a,z,len,i,ch
      character(:),allocatable :: ans
      
      read*,n
      read*,s
      
      
      len = len_trim( s )
      
      allocate( character(len) :: ans )
      
      a = ichar( 'A' )
      z = ichar( 'Z' )
      
      DO i = 1,len
        ch = ichar( s(i:i) )
        ch = ch + n
        if( ch>z )then
          ch = ch - 26
        end if
        ans(i:i) = char( ch )
      END DO
      
      print*,trim( ans )
      
      END PROGRAM
; 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 [10000 x i8] undef
@_QQcl.74a426b3c466b5ddbc46f10db1342a66 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_2924/source.f\00"
@_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 i128, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.74a426b3c466b5ddbc46f10db1342a66, i32 8)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 16)
  %6 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %7 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.74a426b3c466b5ddbc46f10db1342a66, i32 9)
  %8 = call i1 @_FortranAioInputAscii(ptr %7, ptr nonnull @_QFEs, i64 10000)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %7)
  br label %10

10:                                               ; preds = %0, %10
  %11 = phi i64 [ 9999, %0 ], [ %15, %10 ]
  %12 = getelementptr [10000 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
  %19 = trunc i64 %11 to i32
  %20 = add i32 %19, 1
  %21 = sext i32 %20 to i128
  %22 = select i1 %14, i128 0, i128 %21
  %23 = call i128 @llvm.smax.i128(i128 %22, i128 0)
  %24 = trunc i128 %23 to i64
  %25 = call ptr @malloc(i64 %24)
  %26 = trunc i128 %22 to i64
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %iter.check, label %._crit_edge

iter.check:                                       ; preds = %18
  %28 = load i128, ptr %3, align 8, !tbaa !3
  %min.iters.check = icmp ult i64 %26, 8
  br i1 %min.iters.check, label %vec.epilog.scalar.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check77 = icmp ult i64 %26, 16
  br i1 %min.iters.check77, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %26, -16
  %broadcast.splatinsert = insertelement <16 x i128> poison, i128 %28, i64 0
  %broadcast.splat = shufflevector <16 x i128> %broadcast.splatinsert, <16 x i128> poison, <16 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %29 = getelementptr [10000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %index
  %wide.load = load <16 x i8>, ptr %29, align 16, !tbaa !3
  %30 = zext <16 x i8> %wide.load to <16 x i128>
  %31 = add <16 x i128> %broadcast.splat, %30
  %32 = icmp sgt <16 x i128> %31, <i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90>
  %33 = trunc <16 x i128> %31 to <16 x i8>
  %34 = add <16 x i8> %33, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26>
  %35 = select <16 x i1> %32, <16 x i8> %34, <16 x i8> %33
  %36 = getelementptr [1 x i8], ptr %25, i64 %index
  store <16 x i8> %35, ptr %36, align 1
  %index.next = add nuw i64 %index, 16
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !7

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %26
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end80 = or i64 %n.vec, 1
  %n.vec.remaining = and i64 %26, 8
  %min.epilog.iters.check.not.not = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check.not.not, label %vec.epilog.scalar.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec79 = and i64 %26, -8
  %ind.end = or i64 %n.vec79, 1
  %broadcast.splatinsert85 = insertelement <8 x i128> poison, i128 %28, i64 0
  %broadcast.splat86 = shufflevector <8 x i128> %broadcast.splatinsert85, <8 x i128> poison, <8 x i32> zeroinitializer
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index82 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next87, %vec.epilog.vector.body ]
  %38 = getelementptr [10000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %index82
  %wide.load84 = load <8 x i8>, ptr %38, align 8, !tbaa !3
  %39 = zext <8 x i8> %wide.load84 to <8 x i128>
  %40 = add <8 x i128> %broadcast.splat86, %39
  %41 = icmp sgt <8 x i128> %40, <i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90, i128 90>
  %42 = trunc <8 x i128> %40 to <8 x i8>
  %43 = add <8 x i8> %42, <i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26, i8 -26>
  %44 = select <8 x i1> %41, <8 x i8> %43, <8 x i8> %42
  %45 = getelementptr [1 x i8], ptr %25, i64 %index82
  store <8 x i8> %44, ptr %45, align 1
  %index.next87 = add nuw i64 %index82, 8
  %46 = icmp eq i64 %index.next87, %n.vec79
  br i1 %46, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !10

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n81 = icmp eq i64 %n.vec79, %26
  br i1 %cmp.n81, label %._crit_edge, label %vec.epilog.scalar.ph.preheader

vec.epilog.scalar.ph.preheader:                   ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
  %.ph = phi i64 [ 1, %iter.check ], [ %ind.end80, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  br label %vec.epilog.scalar.ph

vec.epilog.scalar.ph:                             ; preds = %vec.epilog.scalar.ph.preheader, %vec.epilog.scalar.ph
  %47 = phi i64 [ %54, %vec.epilog.scalar.ph ], [ %.ph, %vec.epilog.scalar.ph.preheader ]
  %48 = add nsw i64 %47, -1
  %49 = getelementptr [10000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %48
  %.unpack = load i8, ptr %49, align 1, !tbaa !3
  %50 = zext i8 %.unpack to i128
  %51 = add i128 %28, %50
  %52 = icmp sgt i128 %51, 90
  %extract.t72 = trunc i128 %51 to i8
  %extract.t = add i8 %extract.t72, -26
  %.0.off0 = select i1 %52, i8 %extract.t, i8 %extract.t72
  %53 = getelementptr [1 x i8], ptr %25, i64 %48
  store i8 %.0.off0, ptr %53, align 1
  %54 = add nuw nsw i64 %47, 1
  %exitcond.not = icmp eq i64 %47, %26
  br i1 %exitcond.not, label %._crit_edge, label %vec.epilog.scalar.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %vec.epilog.scalar.ph, %middle.block, %vec.epilog.middle.block, %18
  %55 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.74a426b3c466b5ddbc46f10db1342a66, i32 28)
  store ptr %25, ptr %1, align 8, !tbaa !12
  %.fca.1.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 %24, ptr %.fca.1.gep23, align 8, !tbaa !12
  %.fca.2.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep25, align 8, !tbaa !12
  %.fca.3.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep27, align 4, !tbaa !12
  %.fca.4.gep29 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep29, align 1, !tbaa !12
  %.fca.5.gep31 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep31, align 2, !tbaa !12
  %.fca.6.gep33 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep33, align 1, !tbaa !12
  %.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 !12
  %.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 !12
  %.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 !12
  %.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 !12
  %.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 !12
  %56 = call {} @_FortranATrim(ptr nonnull %2, ptr nonnull %1, ptr nonnull @_QQcl.74a426b3c466b5ddbc46f10db1342a66, i32 28)
  %.fca.0.load = load ptr, ptr %2, align 8, !tbaa !12
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !12
  %57 = call i1 @_FortranAioOutputAscii(ptr %55, ptr %.fca.0.load, i64 %.fca.1.load)
  call void @free(ptr %.fca.0.load)
  %58 = call i32 @_FortranAioEndIoStatement(ptr %55)
  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 @_FortranAioBeginExternalListOutput(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 i128 @llvm.smax.i128(i128, i128) #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 = distinct !{!7, !8, !9}
!8 = !{!"llvm.loop.isvectorized", i32 1}
!9 = !{!"llvm.loop.unroll.runtime.disable"}
!10 = distinct !{!10, !8, !9}
!11 = distinct !{!11, !9, !8}
!12 = !{!13, !13, i64 0}
!13 = !{!"descriptor member", !5, i64 0}
