#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, a, d, k, 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++) {
    a = ch[j] - 96;
    k = ch[j] + a;
    if (k <= 122) {
      printf("%c", (char)k);
    } else {
      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,-0x1b4(%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    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    11a8 <main+0x88>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1146 <main+0x26>
movl   $0x0,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%eax
cmp    -0x1b4(%rbp),%eax
jge    1270 <main+0x150>
movslq -0x1b8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
sub    $0x60,%eax
mov    %eax,-0x1a8(%rbp)
movslq -0x1b8(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
add    -0x1a8(%rbp),%eax
mov    %eax,-0x1b0(%rbp)
cmpl   $0x7a,-0x1b0(%rbp)
jg     1230 <main+0x110>
mov    -0x1b0(%rbp),%eax
lea    0xddd(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    1257 <main+0x137>
mov    -0x1b0(%rbp),%eax
sub    $0x7a,%eax
add    $0x60,%eax
mov    %eax,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
lea    0xdb1(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
jmp    125c <main+0x13c>
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%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     119a <main+0x7a>
mov    %ebp,%r15d
xor    %ebx,%ebx
lea    0xe93(%rip),%r14
nopl   (%rax)
mov    (%rsp,%rbx,4),%eax
lea    (%rax,%rax,1),%ecx
add    $0xffffffa0,%ecx
add    %eax,%eax
add    $0x86,%al
cmp    $0x7b,%ecx
movzbl %al,%eax
cmovl  %ecx,%eax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <main+0x50>
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* %7
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* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
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* %8
br label %36
36: ; preds = %66, %35
%37 = load i32, i32* %8
%38 = load i32, i32* %7
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %69
40: ; preds = %36
%41 = load i32, i32* %8
%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* %4
%46 = load i32, i32* %8
%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* %4
%51 = add nsw i32 %49, %50
store i32 %51, i32* %6
%52 = load i32, i32* %6
%53 = icmp sle i32 %52, 122
br i1 %53, label %54, label %58
54: ; preds = %40
%55 = load i32, i32* %6
%56 = trunc i32 %55 to i8
%57 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %56)
br label %65
58: ; preds = %40
%59 = load i32, i32* %6
%60 = sub nsw i32 %59, 122
%61 = add nsw i32 %60, 96
store i32 %61, i32* %5
%62 = load i32, i32* %5
%63 = trunc i32 %62 to i8
%64 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %63)
br label %65
65: ; preds = %58, %54
br label %66
66: ; preds = %65
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %36
69: ; 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 = %19, %3
ret i32 0
19: ; preds = %5, %19
%20 = phi i64 [ 0, %5 ], [ %31, %19 ]
%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
%26 = trunc i32 %24 to i8
%27 = trunc i32 %23 to i8
%28 = add i8 %27, -122
%29 = select i1 %25, i8 %26, i8 %28
%30 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
%31 = add nuw nsw i64 %20, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %18, label %19
}