#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 */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int strlen(char *);
int main() {
  char A[201];
  int i;
  char temp;
  int len;
  while (scanf("%s", A) != EOF) {
    len = strlen(A) - 1;
    i = 0;
    while (i < len) {
      temp = A[i];
      A[i++] = A[len];
      A[len--] = temp;
    }
    printf("%s\n", A);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
je     121f <main+0xdf>
lea    -0xd0(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xdc(%rbp)
movl   $0x0,-0xd4(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0xdc(%rbp),%eax
jge    1207 <main+0xc7>
movslq -0xd4(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%al
mov    %al,-0xd5(%rbp)
movslq -0xdc(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%cl
mov    -0xd4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0xd4(%rbp)
cltq
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0xd5(%rbp),%cl
mov    -0xdc(%rbp),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,-0xdc(%rbp)
cltq
mov    %cl,-0xd0(%rbp,%rax,1)
jmp    1194 <main+0x54>
lea    -0xd0(%rbp),%rsi
lea    0xdee(%rip),%rdi
call   1040 <printf@plt>
jmp    1152 <main+0x12>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd0,%rsp
lea    0xea9(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    0x2e82(%rip),%r12
cmp    (%r12),%rax
jne    1173 <main+0x33>
xor    %edi,%edi
call   1060 <exit@plt>
mov    %rsp,%r13
lea    0xe86(%rip),%r14
lea    0xe7c(%rip),%r15
jmp    11ac <main+0x6c>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmp    (%r12),%rax
je     116c <main+0x2c>
mov    %r13,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     1190 <main+0x50>
mov    %eax,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rcx,1),%edx
movzbl 0x1(%rsp,%rax,1),%ebx
mov    %bl,(%rsp,%rcx,1)
add    $0x1,%rcx
mov    %dl,0x1(%rsp,%rax,1)
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     11d0 <main+0x90>
jmp    1190 <main+0x50>

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

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