#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 /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char str[125], temp;
  int i, lenght;
  scanf("%s", str);
  lenght = strlen(str);
  for (i = 0; i < lenght; i++) {
    temp = str[i];
    str[i] = str[lenght - 1];
    str[lenght - 1] = temp;
    lenght--;
  }
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x9c(%rbp)
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jge    11f2 <main+0xc2>
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,1),%al
mov    %al,-0x91(%rbp)
mov    -0x9c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x90(%rbp,%rax,1),%cl
movslq -0x98(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x91(%rbp),%cl
mov    -0x9c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x9c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1171 <main+0x41>
lea    -0x90(%rbp),%rsi
lea    0xe00(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    117e <main+0x4e>
mov    %eax,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl (%rsp,%rcx,1),%edx
movzbl (%rsp,%rax,1),%ebx
mov    %bl,(%rsp,%rcx,1)
mov    %dl,(%rsp,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1160 <main+0x30>
lea    0xe7b(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

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

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