#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(int argc, char *argv[]) {
  char a[50][1000], i = 0;
  while (scanf("%s", a[i++]) != EOF)
    ;
  i--;
  while (i--)
    printf("%s ", a[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc370,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0xc361(%rbp)
mov    -0xc361(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0xc361(%rbp)
movsbq %al,%rax
lea    -0xc360(%rbp),%rsi
imul   $0x3e8,%rax,%rax
add    %rax,%rsi
lea    0xe93(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e6f(%rip),%rcx
cmp    (%rcx),%rax
je     1187 <main+0x67>
jmp    1140 <main+0x20>
mov    -0xc361(%rbp),%al
add    $0xff,%al
mov    %al,-0xc361(%rbp)
mov    -0xc361(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0xc361(%rbp)
cmp    $0x0,%al
je     11d8 <main+0xb8>
movsbq -0xc361(%rbp),%rax
ff
lea    -0xc360(%rbp),%rsi
imul   $0x3e8,%rax,%rax
add    %rax,%rsi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1195 <main+0x75>
xor    %eax,%eax
add    $0xc370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc350,%rsp
xor    %ebx,%ebx
lea    0xecb(%rip),%r14
mov    0x2eac(%rip),%r15
nopl   0x0(%rax)
movsbq %bl,%rax
add    $0x1,%bl
imul   $0x3e8,%rax,%rax
lea    (%rsp,%rax,1),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
cmp    (%r15),%rax
jne    1140 <main+0x20>
cmp    $0x1,%bl
je     118c <main+0x6c>
add    $0xfe,%bl
lea    0xe95(%rip),%r14
xchg   %ax,%ax
movsbq %bl,%rbx
imul   $0x3e8,%rbx,%rax
lea    (%rsp,%rax,1),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xff,%bl
jb     1170 <main+0x50>
xor    %eax,%eax
add    $0xc350,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x [1000 x i8]]
%4 = getelementptr inbounds [50 x [1000 x i8]], [50 x [1000 x i8]]* %3, i64 0, i64 0, i64 0
br label %5
5: ; preds = %5, %2
%6 = phi i8 [ 0, %2 ], [ %7, %5 ]
%7 = add i8 %6, 1
%8 = sext i8 %6 to i64
%9 = getelementptr inbounds [50 x [1000 x i8]], [50 x [1000 x i8]]* %3, i64 0, i64 %8, i64 0
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = icmp eq i8 %6, 0
br i1 %14, label %22, label %15
15: ; preds = %13, %15
%16 = phi i8 [ %17, %15 ], [ %6, %13 ]
%17 = add i8 %16, -1
%18 = sext i8 %17 to i64
%19 = getelementptr inbounds [50 x [1000 x i8]], [50 x [1000 x i8]]* %3, i64 0, i64 %18, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = icmp eq i8 %17, 0
br i1 %21, label %22, label %15
22: ; preds = %15, %13
ret i32 0
}