#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
int main() {
  int a, n = 0, m;
  char masiv1[64], masiv2[64];
  gets(masiv1);
  a = strlen(masiv1);
  m = a;
  while (n <= a) {
    n + 1;
    masiv2[m] = masiv1[n];
    m--;
  }
  while (m <= a) {
    m + 1;
    printf("%c", masiv2[m]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1191 <main+0x61>
movslq -0xc(%rbp),%rax
mov    -0x50(%rbp,%rax,1),%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <main+0x34>
jmp    1196 <main+0x66>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11bf <main+0x8f>
movslq -0x10(%rbp),%rax
lea    0xe53(%rip),%rdi
movsbl -0x90(%rbp,%rax,1),%esi
ff
call   1040 <printf@plt>
jmp    1196 <main+0x66>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     1168 <main+0x38>
mov    0x40(%rsp),%cl
mov    %eax,%eax
add    %rsp,%rax
nopl   0x0(%rax)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
jmp    1160 <main+0x30>
cltq
movsbl (%rsp,%rax,1),%ebx
lea    0xe8b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1180 <main+0x50>

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

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