#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 main() {
  char imie[256];
  scanf("%s", imie);
  int i = 0;
  while (imie[i] != '\0') {
    i++;
  }
  int j;
  for (j = (i - 1); j >= 0; j--) {
    printf("%c", imie[j]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x114(%rbp)
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     117b <main+0x5b>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    114f <main+0x2f>
mov    -0x114(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x118(%rbp)
cmpl   $0x0,-0x118(%rbp)
jl     11c6 <main+0xa6>
movslq -0x118(%rbp),%rax
lea    0xe5e(%rip),%rdi
movsbl -0x110(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
mov    -0x118(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x118(%rbp)
jmp    118a <main+0x6a>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
lea    0xecd(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
nopl   (%rax)
cmpb   $0x0,(%rsp,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1140 <main+0x20>
cmp    $0x1,%ebx
je     117b <main+0x5b>
lea    -0x1(%rbx),%r15d
add    $0xffffffffffffffff,%r15
lea    0xea5(%rip),%r14
xchg   %ax,%ax
mov    %r15d,%eax
movsbl (%rsp,%rax,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
add    $0xffffffffffffffff,%r15
cmp    $0x1,%ebx
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 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)
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ %9, %4 ], [ 0, %0 ]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %24, label %13
13: ; preds = %10
%14 = and i64 %5, 4294967295
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ %14, %13 ], [ %17, %15 ]
%17 = add nsw i64 %16, -1
%18 = and i64 %17, 4294967295
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %20)
%22 = trunc i64 %16 to i32
%23 = icmp sgt i32 %22, 1
br i1 %23, label %15, label %24
24: ; preds = %15, %10
ret i32 0
}