#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 *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int strlen(char *);
main() {
  int i;
  char string[501];
  scanf("%s", &string);
  for (i = 0; i < strlen(string); i++) {
    if (i % 2 == 0)
      printf("%c", string[i + 1]);
    else
      printf("%c", string[i - 1]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x200(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x204(%rbp)
lea    -0x200(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x204(%rbp),%eax
cmp    %ecx,%eax
jge    11e9 <main+0xb9>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b8 <main+0x88>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x200(%rbp,%rax,1),%esi
ff
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d6 <main+0xa6>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x200(%rbp,%rax,1),%esi
ff
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11db <main+0xab>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115c <main+0x2c>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1f8,%rsp
lea    0xebf(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1193 <main+0x63>
xor    %ebx,%ebx
jmp    117e <main+0x4e>
nopl   0x0(%rax)
movsbl -0x1(%rbx,%r14,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1193 <main+0x63>
test   $0x1,%bl
jne    1160 <main+0x30>
movsbl 0x1(%rsp,%rbx,1),%edi
add    $0x1,%rbx
call   1030 <putchar@plt>
jmp    116f <main+0x3f>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [501 x i8]
%2 = getelementptr inbounds [501 x i8], [501 x i8]* %1, i64 0, i64 0
%3 = bitcast [501 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @strlen(i8* %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %29
7: ; preds = %0, %24
%8 = phi i64 [ %25, %24 ], [ 0, %0 ]
%9 = and i64 %8, 1
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = add nuw nsw i64 %8, 1
%13 = getelementptr inbounds [501 x i8], [501 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 @putchar(i32 %15)
br label %24
17: ; preds = %7
%18 = add nsw i64 %8, -1
%19 = getelementptr inbounds [501 x i8], [501 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 @putchar(i32 %21)
%23 = add nuw nsw i64 %8, 1
br label %24
24: ; preds = %11, %17
%25 = phi i64 [ %12, %11 ], [ %23, %17 ]
%26 = call i32 @strlen(i8* %2)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %7, label %29
29: ; preds = %24, %0
%30 = call i32 @putchar(i32 10)
ret i32 0
}