#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 */
typedef int /*<<< orphan*/ dataString;

/* Variables and functions */
char getchar();
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char dataString[1023];
  memset(dataString, 0, sizeof(dataString));
  int i = 0;
  while (1) {
    char c = getchar();
    if (c == '.' || i > sizeof(dataString) / sizeof(dataString[0]))
      break;
    else {
      dataString[i] = c;
      if (i % 2 == 0)
        dataString[i]++;
      else
        dataString[i]--;
      i++;
    }
  }
  printf("%s\n", dataString);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x3ff,%edx
call   1040 <memset@plt>
movl   $0x0,-0x414(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x415(%rbp)
movsbl -0x415(%rbp),%eax
cmp    $0x2e,%eax
je     118f <main+0x5f>
movslq -0x414(%rbp),%rax
cmp    $0x3ff,%rax
jbe    1194 <main+0x64>
jmp    1208 <main+0xd8>
mov    -0x415(%rbp),%cl
movslq -0x414(%rbp),%rax
mov    %cl,-0x410(%rbp,%rax,1)
mov    -0x414(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11dc <main+0xac>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%cl
add    $0x1,%cl
mov    %cl,-0x410(%rbp,%rax,1)
jmp    11f4 <main+0xc4>
movslq -0x414(%rbp),%rax
mov    -0x410(%rbp,%rax,1),%cl
add    $0xff,%cl
mov    %cl,-0x410(%rbp,%rax,1)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    115f <main+0x2f>
lea    -0x410(%rbp),%rsi
lea    0xdea(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x3ff,%edx
call   1040 <memset@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x2e,%al
je     118d <main+0x5d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%ecx
and    $0x1,%ecx
neg    %rcx
sbb    %ecx,%ecx
or     $0x1,%cl
add    %al,%cl
mov    %cl,(%rsp,%rbx,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x2e,%al
je     118d <main+0x5d>
lea    0x1(%rbx),%rcx
cmp    $0x3ff,%rbx
mov    %rcx,%rbx
jb     1160 <main+0x30>
lea    0xe6c(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1023 x i8]
%2 = getelementptr inbounds [1023 x i8], [1023 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 1023)
%4 = call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 46
br i1 %5, label %19, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %14, %6 ], [ 0, %0 ]
%8 = phi i8 [ %15, %6 ], [ %4, %0 ]
%9 = getelementptr inbounds [1023 x i8], [1023 x i8]* %1, i64 0, i64 %7
%10 = and i64 %7, 1
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8 1, i8 -1
%13 = add i8 %12, %8
store i8 %13, i8* %9
%14 = add nuw nsw i64 %7, 1
%15 = call signext i8 (...) @getchar()
%16 = icmp eq i8 %15, 46
%17 = icmp ugt i64 %7, 1022
%18 = select i1 %16, i1 true, i1 %17
br i1 %18, label %19, label %6
19: ; preds = %6, %0
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}