#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() {
  int i;
  char c[10];
  for (i = 0; i < 10; scanf(" %c", c + i++))
    ;
  for (i = 9; i >= 0; printf("%c ", c[i--]))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116a <main+0x4a>
jmp    1145 <main+0x25>
lea    -0x12(%rbp),%rsi
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
add    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1040 <scanf@plt>
jmp    1136 <main+0x16>
movl   $0x9,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     11a3 <main+0x83>
jmp    1180 <main+0x60>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cltq
lea    0xe70(%rip),%rdi
movsbl -0x12(%rbp,%rax,1),%esi
call   1030 <printf@plt>
jmp    1171 <main+0x51>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x6(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x7(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x9(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xa(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xb(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xd(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
lea    0xe4a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xd(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0xa(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x9(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movsbl 0x6(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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