#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 getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  int ch[100];
  int i, c = 0;
  for (i = 0; i < 100; i++) {
    ch[i] = getchar();
    if (ch[i] >= 97 && ch[i] <= 122)
      c++;
  }
  for (int j = 0; j < c; j++) {
    int a = ch[j] - 96;
    int k = ch[j] + a;
    if (k <= 122) {
      printf("%c", ch[k]);
    } else {
      int d = k - 122 + 96;
      printf("%c", (char)d);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1a8(%rbp)
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    11bc <main+0x9c>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
movslq -0x1a4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
movslq -0x1a4(%rbp),%rax
cmpl   $0x61,-0x1a0(%rbp,%rax,4)
61
jl     11a3 <main+0x83>
movslq -0x1a4(%rbp),%rax
cmpl   $0x7a,-0x1a0(%rbp,%rax,4)
7a
jg     11a3 <main+0x83>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    11a8 <main+0x88>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1146 <main+0x26>
movl   $0x0,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
jge    1278 <main+0x158>
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
sub    $0x60,%eax
mov    %eax,-0x1b0(%rbp)
movslq -0x1ac(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    -0x1b0(%rbp),%eax
mov    %eax,-0x1b4(%rbp)
cmpl   $0x7a,-0x1b4(%rbp)
jg     1238 <main+0x118>
movslq -0x1b4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
lea    0xdd5(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    125f <main+0x13f>
mov    -0x1b4(%rbp),%eax
sub    $0x7a,%eax
add    $0x60,%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%eax
lea    0xda9(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1264 <main+0x144>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11c6 <main+0xa6>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0xffffff9f,%eax
cmp    $0x1a,%eax
adc    $0x0,%ebp
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1140 <main+0x20>
test   %ebp,%ebp
je     119f <main+0x7f>
mov    %ebp,%r15d
xor    %ebx,%ebx
lea    0xe93(%rip),%r14
jmp    1188 <main+0x68>
nop
add    %eax,%eax
add    $0x86,%al
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     119f <main+0x7f>
mov    (%rsp,%rbx,4),%eax
lea    (%rax,%rax,1),%ecx
add    $0xffffffa0,%ecx
cmp    $0x7a,%ecx
jg     1170 <main+0x50>
movslq %ecx,%rax
movzbl (%rsp,%rax,4),%eax
jmp    1174 <main+0x54>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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