#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 */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char str[101];
  int j, n, n1;
  scanf("%s", str);
  scanf("%d", &n);
  n1 = n;
  if (n1 > 26)
    n1 = n1 % 26;
  for (j = 0; str[j] != '\0'; j++) {
    str[j] = str[j] + n1;
    if (str[j] > 'z')
      str[j] = str[j] + 'a' - 'z' - 1;
  }
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x78(%rbp),%eax
mov    %eax,-0x7c(%rbp)
cmpl   $0x1a,-0x7c(%rbp)
jle    1174 <main+0x54>
mov    -0x7c(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x7c(%rbp)
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11e4 <main+0xc4>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    -0x7c(%rbp),%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jle    11d1 <main+0xb1>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    $0x61,%eax
sub    $0x7a,%eax
sub    $0x1,%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
jmp    11d6 <main+0xb6>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    117b <main+0x5b>
lea    -0x70(%rbp),%rsi
lea    0xe11(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
lea    0xed5(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%cl
test   %cl,%cl
je     11b1 <main+0x91>
mov    0xc(%rsp),%eax
cmp    $0x1b,%eax
jl     117c <main+0x5c>
movslq %eax,%rdx
imul   $0x4ec4ec4f,%rdx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%eax
lea    0x11(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %al,%cl
lea    -0x1a(%rcx),%esi
cmp    $0x7b,%cl
movzbl %cl,%ecx
movzbl %sil,%esi
cmovl  %ecx,%esi
mov    %sil,-0x1(%rdx)
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1190 <main+0x70>
lea    0xe48(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i8, i8* %3
%9 = icmp eq i8 %8, 0
br i1 %9, label %27, label %10
10: ; preds = %0
%11 = icmp sgt i32 %7, 26
%12 = srem i32 %7, 26
%13 = select i1 %11, i32 %12, i32 %7
%14 = trunc i32 %13 to i8
br label %15
15: ; preds = %10, %15
%16 = phi i64 [ 0, %10 ], [ %23, %15 ]
%17 = phi i8 [ %8, %10 ], [ %25, %15 ]
%18 = phi i8* [ %3, %10 ], [ %24, %15 ]
%19 = add i8 %17, %14
%20 = icmp sgt i8 %19, 122
%21 = add i8 %19, -26
%22 = select i1 %20, i8 %21, i8 %19
store i8 %22, i8* %18
%23 = add nuw nsw i64 %16, 1
%24 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %15
27: ; preds = %15, %0
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}