#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 main() {
  int i, n;
  char a[] = "bzdrzq";
  char b[100];
  for (i = 0; a[i] != '\0'; i++) {
    n = (a[i] - 'a' + 1) % 26;
    b[i] = 'a' + n;
  }
  b[i] = '\0';
  printf("a: %s\n", a);
  printf("b: %s\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0xf(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0xd(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x13(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1190 <main+0x80>
movslq -0x8(%rbp),%rax
movsbl -0x13(%rbp,%rax,1),%eax
sub    $0x61,%eax
add    $0x1,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x36>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x80(%rbp,%rax,1)
lea    -0x13(%rbp),%rsi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movl   $0x717a72,0xb(%rsp)
movl   $0x72647a62,0x8(%rsp)
72
mov    $0x62,%cl
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
add    $0xffffffa0,%ecx
imul   $0x4ec5,%ecx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
shr    $0x13,%edx
add    %esi,%edx
lea    (%rdx,%rdx,4),%esi
lea    (%rsi,%rsi,4),%esi
add    %edx,%esi
sub    %esi,%ecx
add    $0x61,%cl
mov    %cl,0x10(%rsp,%rax,1)
movzbl 0x9(%rsp,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1130 <main+0x20>
mov    %eax,%eax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xe95(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i8] c"bzdrzq\00"
@.str = [7 x i8] c"a: %s\0A\00"
@.str.1 = [7 x i8] c"b: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [7 x i8]
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = bitcast [7 x i8]* %4 to i8*
store i32 0, i32* %2
br label %7
7: ; preds = %29, %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %7
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 1
%22 = srem i32 %21, 26
store i32 %22, i32* %3
%23 = load i32, i32* %3
%24 = add nsw i32 97, %23
%25 = trunc i32 %24 to i8
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %27
store i8 %25, i8* %28
br label %29
29: ; preds = %14
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %7
32: ; preds = %7
%33 = load i32, i32* %2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %34
store i8 0, i8* %35
%36 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %38)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i8] c"bzdrzq\00"
@.str = [7 x i8] c"a: %s\0A\00"
@.str.1 = [7 x i8] c"b: %s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %0, %5
%6 = phi i64 [ 0, %0 ], [ %14, %5 ]
%7 = phi i8 [ 98, %0 ], [ %16, %5 ]
%8 = sext i8 %7 to i16
%9 = add nsw i16 %8, -96
%10 = srem i16 %9, 26
%11 = trunc i16 %10 to i8
%12 = add nsw i8 %11, 97
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %6
store i8 %12, i8* %13
%14 = add nuw nsw i64 %6, 1
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %5
18: ; preds = %5
%19 = and i64 %14, 4294967295
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %19
store i8 0, i8* %20
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}