#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 alpha(char);
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] = alpha(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   1050 <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     11a3 <main+0x63>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x7d(%rbp)
je     11a3 <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    11b3 <main+0x73>
jmp    11d2 <main+0x92>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,%cl
movslq -0x7c(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
jmp    1163 <main+0x23>
lea    0xe27(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1060 <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    1244 <main+0x104>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    -0x74(%rbp),%eax
movsbl %al,%edi
call   1040 <alpha@plt>
mov    %al,%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x78(%rbp),%rax
lea    0xdd7(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    11f7 <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   1050 <getchar@plt>
mov    %al,0x10(%rsp)
movabs $0x100000401,%r14
xor    %r15d,%r15d
jmp    1183 <main+0x43>
cs nopw 0x0(%rax,%rax,1)
lea    0x1(%r15),%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %al,0x11(%rsp,%r15,1)
mov    %rbx,%r15
cmp    $0x20,%al
ja     1170 <main+0x30>
movzbl %al,%eax
bt     %rax,%r14
jae    1170 <main+0x30>
lea    0xe69(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <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     1239 <main+0xf9>
add    0x10(%rsp),%al
movsbl %al,%edi
call   1040 <alpha@plt>
mov    %al,0x10(%rsp)
movsbl %al,%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x1,%r15d
je     1239 <main+0xf9>
mov    %r15d,%r15d
mov    $0x1,%ebx
lea    0xe02(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%rbx,1),%eax
add    0xc(%rsp),%al
movsbl %al,%edi
call   1040 <alpha@plt>
mov    %al,0x10(%rsp,%rbx,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1210 <main+0xd0>
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 = %64, %38
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %67
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 = call signext i8 @alpha(i8 signext %54)
%56 = load i32, i32* %4
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %57
store i8 %55, i8* %58
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %62)
br label %64
64: ; preds = %46
%65 = load i32, i32* %4
%66 = add nsw i32 %65, 1
store i32 %66, i32* %4
br label %42
67: ; 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 %39, 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
%25 = call signext i8 @alpha(i8 signext %24)
store i8 %25, i8* %21
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %25)
%27 = icmp eq i64 %20, 1
br i1 %27, label %39, label %28
28: ; preds = %19, %28
%29 = phi i64 [ %37, %28 ], [ 1, %19 ]
%30 = load i32, i32* %2
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %29
%32 = load i8, i8* %31
%33 = trunc i32 %30 to i8
%34 = add i8 %32, %33
%35 = call signext i8 @alpha(i8 signext %34)
store i8 %35, i8* %31
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %35)
%37 = add nuw nsw i64 %29, 1
%38 = icmp eq i64 %37, %20
br i1 %38, label %39, label %28
39: ; preds = %28, %19, %13
ret i32 0
}