#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__ feof(int /*<<< orphan*/);
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int main() {
  char str[1000];
  int ch;
  while (1) {
    fscanf(stdin, "%s", str);
    if (feof(stdin))
      break;
    printf("%s ", str);
    fscanf(stdin, "%s", str);
    fscanf(stdin, "%s", str);
    fscanf(stdin, "%s", str);
    fscanf(stdin, "%s", str);
    fscanf(stdin, "%s", str);
    while (1) {
      fscanf(stdin, "%s", str);
      if (!strcmp(str, "
"))
        break;
      printf("%s ", str);
    }
    printf("\n");
    ch = 0;
    while (ch != '\n')
      ch = fgetc(stdin);
    ch = fgetc(stdin);
    if (feof(stdin))
      break;
    ungetc(ch, stdin);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xe77(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     11ab <main+0x4b>
jmp    132b <main+0x1cb>
lea    -0x3f0(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xe29(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xe0d(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xdf1(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xdd5(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xdb9(%rip),%rsi
call   1040 <fscanf@plt>
mov    0x2d95(%rip),%rax
mov    (%rax),%edi
lea    -0x3f0(%rbp),%rdx
lea    0xd9d(%rip),%rsi
call   1040 <fscanf@plt>
lea    -0x3f0(%rbp),%rdi
lea    0xd91(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1289 <main+0x129>
jmp    12a3 <main+0x143>
lea    -0x3f0(%rbp),%rsi
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0xec>
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3f4(%rbp)
cmpl   $0xa,-0x3f4(%rbp)
je     12e1 <main+0x181>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %eax,-0x3f4(%rbp)
jmp    12bb <main+0x15b>
mov    0x2d00(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %eax,-0x3f4(%rbp)
mov    0x2cec(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
cmp    $0x0,%rax
je     1312 <main+0x1b2>
jmp    132b <main+0x1cb>
mov    -0x3f4(%rbp),%edi
mov    0x2cc9(%rip),%rax
mov    (%rax),%esi
call   1080 <ungetc@plt>
jmp    1172 <main+0x12>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    0x2e70(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xe7e(%rip),%rsi
mov    %rsp,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
call   1070 <feof@plt>
test   %rax,%rax
jne    12af <main+0x14f>
lea    0xe61(%rip),%r14
mov    %rsp,%rbx
lea    0xe54(%rip),%r15
mov    $0x3e732f3c,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    (%rsp),%eax
xor    %r13d,%eax
movzbl 0x4(%rsp),%ecx
or     %eax,%ecx
je     1250 <main+0xf0>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1220 <main+0xc0>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
nopw   0x0(%rax,%rax,1)
mov    0x0(%rbp),%edi
call   1060 <fgetc@plt>
cmp    $0xa,%eax
jne    1260 <main+0x100>
mov    0x0(%rbp),%edi
call   1060 <fgetc@plt>
mov    %eax,%r12d
mov    0x0(%rbp),%edi
call   1070 <feof@plt>
test   %rax,%rax
jne    12af <main+0x14f>
mov    0x0(%rbp),%esi
mov    %r12d,%edi
call   1080 <ungetc@plt>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <fscanf@plt>
mov    0x0(%rbp),%edi
call   1070 <feof@plt>
test   %rax,%rax
je     11c0 <main+0x60>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [5 x i8] c"
\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %56
%5 = load i32, i32* @stdin
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stdin
%9 = call i64 @feof(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %60
12: ; preds = %4
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stdin
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%17 = call i32 @fscanf(i32 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stdin
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%20 = call i32 @fscanf(i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i32, i32* @stdin
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%23 = call i32 @fscanf(i32 %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @stdin
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%26 = call i32 @fscanf(i32 %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = load i32, i32* @stdin
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%29 = call i32 @fscanf(i32 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %12, %38
%31 = load i32, i32* @stdin
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%33 = call i32 @fscanf(i32 %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp ne i32 %35, 0
br i1 %36, label %38, label %37
37: ; preds = %30
br label %41
38: ; preds = %30
%39 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %39)
br label %30
41: ; preds = %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %43
43: ; preds = %46, %41
%44 = load i32, i32* %3
%45 = icmp ne i32 %44, 10
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* @stdin
%48 = call i32 @fgetc(i32 %47)
store i32 %48, i32* %3
br label %43
49: ; preds = %43
%50 = load i32, i32* @stdin
%51 = call i32 @fgetc(i32 %50)
store i32 %51, i32* %3
%52 = load i32, i32* @stdin
%53 = call i64 @feof(i32 %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %49
br label %60
56: ; preds = %49
%57 = load i32, i32* %3
%58 = load i32, i32* @stdin
%59 = call i32 @ungetc(i32 %57, i32 %58)
br label %4
60: ; preds = %55, %11
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s \00"
@.str.2 = [5 x i8] c"
\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fscanf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @stdin
%6 = call i64 @feof(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %50
8: ; preds = %0, %42
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%10 = load i32, i32* @stdin
%11 = call i32 @fscanf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%12 = load i32, i32* @stdin
%13 = call i32 @fscanf(i32 %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%14 = load i32, i32* @stdin
%15 = call i32 @fscanf(i32 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%16 = load i32, i32* @stdin
%17 = call i32 @fscanf(i32 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%18 = load i32, i32* @stdin
%19 = call i32 @fscanf(i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%20 = load i32, i32* @stdin
%21 = call i32 @fscanf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%22 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 5)
%23 = icmp eq i32 %22, 0
br i1 %23, label %30, label %24
24: ; preds = %8, %24
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%26 = load i32, i32* @stdin
%27 = call i32 @fscanf(i32 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%28 = call i32 @bcmp(i8* dereferenceable(5) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i64 5)
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %24
30: ; preds = %24, %8
%31 = call i32 @putchar(i32 10)
br label %32
32: ; preds = %30, %32
%33 = load i32, i32* @stdin
%34 = call i32 @fgetc(i32 %33)
%35 = icmp eq i32 %34, 10
br i1 %35, label %36, label %32
36: ; preds = %32
%37 = load i32, i32* @stdin
%38 = call i32 @fgetc(i32 %37)
%39 = load i32, i32* @stdin
%40 = call i64 @feof(i32 %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %50
42: ; preds = %36
%43 = load i32, i32* @stdin
%44 = call i32 @ungetc(i32 %38, i32 %43)
%45 = load i32, i32* @stdin
%46 = call i32 @fscanf(i32 %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%47 = load i32, i32* @stdin
%48 = call i64 @feof(i32 %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %8, label %50
50: ; preds = %42, %36, %0
ret i32 0
}