#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 num[25], temp;
  int i, j;
  scanf("%s", num);
  int lnth = strlen(num);
  for (i = 0, j = lnth - 1; i < lnth / 2; i++, j--) {
    temp = num[i];
    num[i] = num[j];
    num[j] = temp;
  }
  printf("%s\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    11c6 <main+0x96>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%al
mov    %al,-0x21(%rbp)
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%cl
movslq -0x28(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x21(%rbp),%cl
movslq -0x2c(%rbp),%rax
mov    %cl,-0x20(%rbp,%rax,1)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    116b <main+0x3b>
lea    -0x20(%rbp),%rsi
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xec2(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     11d2 <main+0xa2>
mov    %eax,%ecx
shr    %eax
cmp    $0x1,%eax
jne    1167 <main+0x37>
xor    %edx,%edx
test   $0x1,%al
jne    11c2 <main+0x92>
jmp    11d2 <main+0xa2>
mov    %rcx,%rsi
shr    %rsi
and    $0xfffffffe,%esi
neg    %rsi
mov    $0x1,%edx
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rsp,%rdx,1),%edi
movzbl -0x1(%rsp,%rcx,1),%ebx
mov    %bl,-0x1(%rsp,%rdx,1)
mov    %dil,-0x1(%rsp,%rcx,1)
movzbl (%rsp,%rdx,1),%edi
movzbl -0x2(%rsp,%rcx,1),%ebx
mov    %bl,(%rsp,%rdx,1)
mov    %dil,-0x2(%rsp,%rcx,1)
add    $0xfffffffffffffffe,%rcx
lea    (%rsi,%rdx,1),%rdi
add    $0x2,%rdi
add    $0x2,%rdx
cmp    $0x1,%rdi
jne    1180 <main+0x50>
add    $0xffffffffffffffff,%rdx
test   $0x1,%al
je     11d2 <main+0xa2>
mov    (%rsp,%rdx,1),%al
mov    -0x1(%rcx,%r14,1),%bl
mov    %bl,(%rsp,%rdx,1)
mov    %al,-0x1(%rcx,%r14,1)
lea    0xe2a(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 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, 1
br i1 %5, label %6, label %42
6: ; preds = %0
%7 = lshr i32 %4, 1
%8 = zext i32 %4 to i64
%9 = zext i32 %7 to i64
%10 = and i64 %9, 1
%11 = icmp eq i32 %7, 1
br i1 %11, label %32, label %12
12: ; preds = %6
%13 = and i64 %9, 2147483646
br label %14
14: ; preds = %14, %12
%15 = phi i64 [ 0, %12 ], [ %29, %14 ]
%16 = phi i64 [ %8, %12 ], [ %24, %14 ]
%17 = phi i64 [ 0, %12 ], [ %30, %14 ]
%18 = add nsw i64 %16, -1
%19 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %15
%20 = load i8, i8* %19
%21 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %18
%22 = load i8, i8* %21
store i8 %22, i8* %19
store i8 %20, i8* %21
%23 = or i64 %15, 1
%24 = add nsw i64 %16, -2
%25 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %23
%26 = load i8, i8* %25
%27 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %24
%28 = load i8, i8* %27
store i8 %28, i8* %25
store i8 %26, i8* %27
%29 = add nuw nsw i64 %15, 2
%30 = add i64 %17, 2
%31 = icmp eq i64 %30, %13
br i1 %31, label %32, label %14
32: ; preds = %14, %6
%33 = phi i64 [ 0, %6 ], [ %29, %14 ]
%34 = phi i64 [ %8, %6 ], [ %24, %14 ]
%35 = icmp eq i64 %10, 0
br i1 %35, label %42, label %36
36: ; preds = %32
%37 = add nsw i64 %34, -1
%38 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %33
%39 = load i8, i8* %38
%40 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %37
%41 = load i8, i8* %40
store i8 %41, i8* %38
store i8 %39, i8* %40
br label %42
42: ; preds = %36, %32, %0
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}