#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[100];
  int i = 0, n, j;
  scanf("%s", str);
  while (str[i] != '\0') {
    i++;
  }
  scanf("%d", &n);
  j = 0;
  n = n % 26;
  while (j < i) {
    if (str[j] <= 'z' - n) {
      str[j] = str[j] + n;
      printf("%c", str[j]);
      j++;
    } else if (str[j] > 'z' - n) {
      str[j] = str[j] + (n - 26);
      printf("%c", str[j]);
      j++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     116b <main+0x4b>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    114b <main+0x2b>
lea    0xe91(%rip),%rdi
lea    -0x78(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x78(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0x78(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    124c <main+0x12c>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    $0x7a,%ecx
sub    -0x78(%rbp),%ecx
cmp    %ecx,%eax
jg     11f0 <main+0xd0>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    -0x78(%rbp),%eax
mov    %al,%cl
movslq -0x7c(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x7c(%rbp),%rax
lea    0xe2e(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1247 <main+0x127>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    $0x7a,%ecx
sub    -0x78(%rbp),%ecx
cmp    %ecx,%eax
jle    1242 <main+0x122>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    -0x78(%rbp),%ecx
sub    $0x1a,%ecx
add    %ecx,%eax
mov    %al,%cl
movslq -0x7c(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x7c(%rbp),%rax
lea    0xdd7(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1247 <main+0x127>
jmp    1192 <main+0x72>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xecd(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,0x11(%rsp,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1150 <main+0x30>
lea    0xea1(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <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   %ebx,%ebx
je     1216 <main+0xf6>
movsbl 0x10(%rsp),%ecx
mov    $0x7a,%edx
sub    %eax,%edx
lea    -0x1a(%rcx),%esi
cmp    %ecx,%edx
movzbl %sil,%edx
cmovge %ecx,%edx
add    %al,%dl
mov    %dl,0x10(%rsp)
movsbl %dl,%esi
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x1,%ebx
je     1216 <main+0xf6>
mov    %ebx,%r15d
mov    $0x1,%ebx
lea    0xe2c(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
movsbl 0x10(%rsp,%rbx,1),%ecx
mov    $0x7a,%edx
sub    %eax,%edx
lea    -0x1a(%rcx),%esi
cmp    %ecx,%edx
movzbl %sil,%edx
cmovge %ecx,%edx
add    %al,%dl
mov    %dl,0x10(%rsp,%rbx,1)
movsbl %dl,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [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* %3
%6 = getelementptr inbounds [100 x i8], [100 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)
br label %8
8: ; preds = %15, %0
%9 = load i32, i32* %3
%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, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
store i32 0, i32* %5
%20 = load i32, i32* %4
%21 = srem i32 %20, 26
store i32 %21, i32* %4
br label %22
22: ; preds = %84, %18
%23 = load i32, i32* %5
%24 = load i32, i32* %3
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %85
26: ; preds = %22
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = load i32, i32* %4
%33 = sub nsw i32 122, %32
%34 = icmp sle i32 %31, %33
br i1 %34, label %35, label %54
35: ; preds = %26
%36 = load i32, i32* %5
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = load i32, i32* %4
%42 = add nsw i32 %40, %41
%43 = trunc i32 %42 to i8
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %45
store i8 %43, i8* %46
%47 = load i32, i32* %5
%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 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %50)
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %84
54: ; preds = %26
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = load i32, i32* %4
%61 = sub nsw i32 122, %60
%62 = icmp sgt i32 %59, %61
br i1 %62, label %63, label %83
63: ; preds = %54
%64 = load i32, i32* %5
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = load i32, i32* %4
%70 = sub nsw i32 %69, 26
%71 = add nsw i32 %68, %70
%72 = trunc i32 %71 to i8
%73 = load i32, i32* %5
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %74
store i8 %72, i8* %75
%76 = load i32, i32* %5
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %79)
%81 = load i32, i32* %5
%82 = add nsw i32 %81, 1
store i32 %82, i32* %5
br label %83
83: ; preds = %63, %54
br label %84
84: ; preds = %83, %35
br label %22
85: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [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 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %6
6: ; preds = %6, %0
%7 = phi i64 [ %11, %6 ], [ 0, %0 ]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
%13 = trunc i64 %7 to i32
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = srem i32 %15, 26
store i32 %16, i32* %2
%17 = icmp eq i32 %13, 0
br i1 %17, label %46, label %18
18: ; preds = %12
%19 = and i64 %7, 4294967295
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 122, %16
%24 = icmp slt i32 %23, %22
%25 = trunc i32 %16 to i8
%26 = add i8 %21, -26
%27 = select i1 %24, i8 %26, i8 %21
%28 = add i8 %27, %25
store i8 %28, i8* %20
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %28)
%30 = icmp eq i64 %19, 1
br i1 %30, label %46, label %31
31: ; preds = %18, %31
%32 = phi i64 [ %44, %31 ], [ 1, %18 ]
%33 = load i32, i32* %2
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %32
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = sub nsw i32 122, %33
%38 = icmp slt i32 %37, %36
%39 = trunc i32 %33 to i8
%40 = add i8 %35, -26
%41 = select i1 %38, i8 %40, i8 %35
%42 = add i8 %41, %39
store i8 %42, i8* %34
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %42)
%44 = add nuw nsw i64 %32, 1
%45 = icmp eq i64 %44, %19
br i1 %45, label %46, label %31
46: ; preds = %31, %18, %12
ret i32 0
}