#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 EOF;
int EXIT_SUCCESS;
int getchar();
scalar_t__ islower(int);
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  while ((c = getchar()) != EOF) {
    if (c == 'z') {
      c = 'a';
    } else {
      if (islower(c)) {
        ++c;
      }
    }
    putchar(c);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
je     11a2 <main+0x72>
cmpl   $0x7a,-0x14(%rbp)
jne    1175 <main+0x45>
movl   $0x61,-0x14(%rbp)
jmp    1195 <main+0x65>
mov    -0x14(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     1190 <main+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1195 <main+0x65>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1146 <main+0x16>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
jne    1158 <main+0x28>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %eax,%ebx
jmp    1173 <main+0x43>
nopl   0x0(%rax)
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     1147 <main+0x17>
mov    $0x61,%edi
cmp    $0x7a,%ebx
je     1160 <main+0x30>
mov    %ebx,%edi
call   1040 <islower@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebx
mov    %ebx,%edi
jmp    1160 <main+0x30>

LLVM IR (-O0):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %23, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 122
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 97, i32* %6
br label %23
15: ; preds = %11
%16 = load i32, i32* %6
%17 = call i64 @islower(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %22
22: ; preds = %19, %15
br label %23
23: ; preds = %22, %14
%24 = load i32, i32* %6
%25 = call i32 @putchar(i32 %24)
br label %7
26: ; preds = %7
%27 = load i32, i32* @EXIT_SUCCESS
ret i32 %27
}

LLVM IR (-O2):
@EOF = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %20, label %6
6: ; preds = %2, %14
%7 = phi i32 [ %17, %14 ], [ %3, %2 ]
%8 = icmp eq i32 %7, 122
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i64 @islower(i32 %7)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
%13 = add nsw i32 %7, %12
br label %14
14: ; preds = %9, %6
%15 = phi i32 [ 97, %6 ], [ %13, %9 ]
%16 = tail call i32 @putchar(i32 %15)
%17 = tail call i32 (...) @getchar()
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %6
20: ; preds = %14, %2
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}