#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char arr[100];
  int n, j, i = 0;
  arr[0] = getchar();
  while (arr[i] != '\n' && arr[i] != '\0' && arr[i] != ' ') {
    i++;
    arr[i] = getchar();
  }
  scanf("%d", &n);
  n = n % 26;
  for (j = 0; j < i; j++) {
    arr[j] = arr[j] + n;
    printf("%c", arr[j]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x70(%rbp)
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x7d(%rbp)
je     1193 <main+0x63>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x7d(%rbp)
je     1193 <main+0x63>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x7d(%rbp)
mov    -0x7d(%rbp),%al
test   $0x1,%al
jne    11a3 <main+0x73>
jmp    11c2 <main+0x92>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,%cl
movslq -0x7c(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1153 <main+0x23>
lea    0xe37(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x74(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jge    122c <main+0xfc>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    -0x74(%rbp),%eax
mov    %al,%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x78(%rbp),%rax
lea    0xdef(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11e7 <main+0xb7>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x10(%rsp)
movabs $0x100000401,%r14
xor    %r15d,%r15d
jmp    1173 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%r15),%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,0x11(%rsp,%r15,1)
mov    %rbx,%r15
cmp    $0x20,%al
ja     1160 <main+0x30>
movzbl %al,%eax
bt     %rax,%r14
jae    1160 <main+0x30>
lea    0xe79(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
mov    %eax,0xc(%rsp)
test   %r15d,%r15d
je     1211 <main+0xe1>
add    0x10(%rsp),%al
mov    %al,0x10(%rsp)
movsbl %al,%esi
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x1,%r15d
je     1211 <main+0xe1>
mov    %r15d,%r15d
mov    $0x1,%ebx
lea    0xe1a(%rip),%r14
nopl   0x0(%rax)
movzbl 0x10(%rsp,%rbx,1),%eax
add    0xc(%rsp),%al
mov    %al,0x10(%rsp,%rbx,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    11f0 <main+0xc0>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call signext i8 (...) @getchar()
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 %6, i8* %7
br label %8
8: ; preds = %31, %0
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %29
15: ; preds = %8
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %15
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 32
br label %29
29: ; preds = %22, %15, %8
%30 = phi i1 [ false, %15 ], [ false, %8 ], [ %28, %22 ]
br i1 %30, label %31, label %38
31: ; preds = %29
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = call signext i8 (...) @getchar()
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %36
store i8 %34, i8* %37
br label %8
38: ; preds = %29
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%40 = load i32, i32* %3
%41 = srem i32 %40, 26
store i32 %41, i32* %3
store i32 0, i32* %4
br label %42
42: ; preds = %63, %38
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %66
46: ; preds = %42
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = load i32, i32* %3
%53 = add nsw i32 %51, %52
%54 = trunc i32 %53 to i8
%55 = load i32, i32* %4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %56
store i8 %54, i8* %57
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %61)
br label %63
63: ; preds = %46
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 1
store i32 %65, i32* %4
br label %42
66: ; preds = %42
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call signext i8 (...) @getchar()
store i8 %5, i8* %3
br label %6
6: ; preds = %9, %0
%7 = phi i8 [ %11, %9 ], [ %5, %0 ]
%8 = phi i64 [ %10, %9 ], [ 0, %0 ]
switch i8 %7, label %9 [
i8 10, label %13
i8 0, label %13
i8 32, label %13
]
9: ; preds = %6
%10 = add nuw i64 %8, 1
%11 = tail call signext i8 (...) @getchar()
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %10
store i8 %11, i8* %12
br label %6
13: ; preds = %6, %6, %6
%14 = trunc i64 %8 to i32
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = srem i32 %16, 26
store i32 %17, i32* %2
%18 = icmp eq i32 %14, 0
br i1 %18, label %37, label %19
19: ; preds = %13
%20 = and i64 %8, 4294967295
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%22 = load i8, i8* %21
%23 = trunc i32 %17 to i8
%24 = add i8 %22, %23
store i8 %24, i8* %21
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %24)
%26 = icmp eq i64 %20, 1
br i1 %26, label %37, label %27
27: ; preds = %19, %27
%28 = phi i64 [ %35, %27 ], [ 1, %19 ]
%29 = load i32, i32* %2
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %28
%31 = load i8, i8* %30
%32 = trunc i32 %29 to i8
%33 = add i8 %31, %32
store i8 %33, i8* %30
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %33)
%35 = add nuw nsw i64 %28, 1
%36 = icmp eq i64 %35, %20
br i1 %36, label %37, label %27
37: ; preds = %27, %19, %13
ret i32 0
}