#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() {
  int count;
  char c[400];
  scanf("%s", c);
  count = strlen(c);
  for (; count >= 0; --count) {
    printf("%c \n", c[count]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1194 <main+0x64>
movslq -0x8(%rbp),%rax
lea    0xe8a(%rip),%rdi
movsbl -0x1a0(%rbp,%rax,1),%esi
ff
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x34>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
lea    0xebf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     1182 <main+0x52>
mov    %eax,%ebx
lea    0xea2(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rsp,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1170 <main+0x40>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%c \0A\00"
define i32 @main() {
%1 = alloca [400 x i8]
%2 = getelementptr inbounds [400 x i8], [400 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 %15
6: ; preds = %0
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds [400 x i8], [400 x i8]* %1, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %11)
%13 = add nsw i64 %9, -1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %0
ret i32 0
}