#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 */
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ ReplaceChar(char *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
scalar_t__ strlen(char *);
int main(int argc, char *argv[]) {
  char line[32767];
  while (fgets(line, sizeof(line), stdin) != NULL) {
    char *wtop = NULL, *cp = line;
    int len = (int)strlen(line);
    ReplaceChar(line);
    while ((cp - line) < len) {
      while (*cp == ' ') {
        cp++;
      }
      if (*cp == '\n' || *cp == '\0') {
        break;
      }
      wtop = cp;
      while (*cp != ' ' && *cp != '\n' && *cp != '\0') {
        cp++;
      }
      *cp = '\0';
      printf("%s 1\n", wtop);
      cp++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8030,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8010(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    $0x7fff,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12ec <main+0x1ac>
movq   $0x0,-0x8018(%rbp)
lea    -0x8010(%rbp),%rax
mov    %rax,-0x8020(%rbp)
lea    -0x8010(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x8024(%rbp)
lea    -0x8010(%rbp),%rdi
call   1030 <ReplaceChar@plt>
mov    -0x8020(%rbp),%rax
lea    -0x8010(%rbp),%rcx
sub    %rcx,%rax
movslq -0x8024(%rbp),%rcx
cmp    %rcx,%rax
jge    12e7 <main+0x1a7>
jmp    11da <main+0x9a>
mov    -0x8020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1204 <main+0xc4>
mov    -0x8020(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8020(%rbp)
jmp    11da <main+0x9a>
mov    -0x8020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     122a <main+0xea>
mov    -0x8020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    122f <main+0xef>
jmp    12e7 <main+0x1a7>
mov    -0x8020(%rbp),%rax
mov    %rax,-0x8018(%rbp)
mov    -0x8020(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x8025(%rbp)
je     1289 <main+0x149>
mov    -0x8020(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x8025(%rbp)
je     1289 <main+0x149>
mov    -0x8020(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x8025(%rbp)
mov    -0x8025(%rbp),%al
test   $0x1,%al
jne    129c <main+0x15c>
jmp    12b3 <main+0x173>
mov    -0x8020(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8020(%rbp)
jmp    123d <main+0xfd>
mov    -0x8020(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8018(%rbp),%rsi
lea    0xd35(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8020(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8020(%rbp)
jmp    11b4 <main+0x74>
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0x8030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8008,%rsp
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7fff,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1235 <main+0xf5>
mov    $0x1,%r13d
sub    %rbx,%r13
movabs $0x100000401,%rbp
lea    0xe73(%rip),%r15
jmp    11b2 <main+0x72>
nop
mov    0x2e51(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7fff,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     1235 <main+0xf5>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rbx
call   1030 <ReplaceChar@plt>
mov    %rbx,%rax
shl    $0x20,%rax
test   %rax,%rax
jle    1190 <main+0x50>
movslq %ebx,%rbx
mov    %rsp,%rsi
jmp    11e4 <main+0xa4>
nopl   0x0(%rax)
add    $0x1,%rsi
mov    (%rsi),%al
cmp    $0x20,%al
je     11e0 <main+0xa0>
test   %al,%al
je     1190 <main+0x50>
cmp    $0xa,%al
je     1190 <main+0x50>
lea    0x1(%rsi),%r12
lea    (%rsi,%r13,1),%r14
jmp    120d <main+0xcd>
nopl   0x0(%rax)
movzbl (%r12),%eax
add    $0x1,%r12
add    $0x1,%r14
cmp    $0x20,%al
ja     1200 <main+0xc0>
movzbl %al,%eax
bt     %rax,%rbp
jae    1200 <main+0xc0>
movb   $0x0,-0x1(%r12)
mov    %r15,%rdi
call   1050 <printf@plt>
mov    %r12,%rsi
cmp    %rbx,%r14
jl     11e4 <main+0xa4>
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0x8008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%s 1\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [32767 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %10
10: ; preds = %79, %2
%11 = getelementptr inbounds [32767 x i8], [32767 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @stdin
%13 = call i32* @fgets(i8* %11, i32 32767, i32 %12)
%14 = icmp ne i32* %13, null
br i1 %14, label %15, label %80
15: ; preds = %10
store i8* null, i8** %7
%16 = getelementptr inbounds [32767 x i8], [32767 x i8]* %6, i64 0, i64 0
store i8* %16, i8** %8
%17 = getelementptr inbounds [32767 x i8], [32767 x i8]* %6, i64 0, i64 0
%18 = call i64 @strlen(i8* %17)
%19 = trunc i64 %18 to i32
store i32 %19, i32* %9
%20 = getelementptr inbounds [32767 x i8], [32767 x i8]* %6, i64 0, i64 0
%21 = call i32 @ReplaceChar(i8* %20)
br label %22
22: ; preds = %73, %15
%23 = load i8*, i8** %8
%24 = getelementptr inbounds [32767 x i8], [32767 x i8]* %6, i64 0, i64 0
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = icmp slt i64 %27, %29
br i1 %30, label %31, label %79
31: ; preds = %22
br label %32
32: ; preds = %37, %31
%33 = load i8*, i8** %8
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 32
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %8
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %8
br label %32
40: ; preds = %32
%41 = load i8*, i8** %8
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 10
br i1 %44, label %50, label %45
45: ; preds = %40
%46 = load i8*, i8** %8
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %45, %40
br label %79
51: ; preds = %45
%52 = load i8*, i8** %8
store i8* %52, i8** %7
br label %53
53: ; preds = %70, %51
%54 = load i8*, i8** %8
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 32
br i1 %57, label %58, label %68
58: ; preds = %53
%59 = load i8*, i8** %8
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp ne i32 %61, 10
br i1 %62, label %63, label %68
63: ; preds = %58
%64 = load i8*, i8** %8
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp ne i32 %66, 0
br label %68
68: ; preds = %63, %58, %53
%69 = phi i1 [ false, %58 ], [ false, %53 ], [ %67, %63 ]
br i1 %69, label %70, label %73
70: ; preds = %68
%71 = load i8*, i8** %8
%72 = getelementptr inbounds i8, i8* %71, i32 1
store i8* %72, i8** %8
br label %53
73: ; preds = %68
%74 = load i8*, i8** %8
store i8 0, i8* %74
%75 = load i8*, i8** %7
%76 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %75)
%77 = load i8*, i8** %8
%78 = getelementptr inbounds i8, i8* %77, i32 1
store i8* %78, i8** %8
br label %22
79: ; preds = %50, %22
br label %10
80: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [6 x i8] c"%s 1\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32767 x i8]
%4 = getelementptr inbounds [32767 x i8], [32767 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 32767, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %39, label %8
8: ; preds = %2
%9 = ptrtoint [32767 x i8]* %3 to i64
br label %10
10: ; preds = %8, %35
%11 = call i64 @strlen(i8* %4)
%12 = call i32 @ReplaceChar(i8* %4)
%13 = shl i64 %11, 32
%14 = ashr exact i64 %13, 32
%15 = icmp sgt i64 %13, 0
br i1 %15, label %16, label %35
16: ; preds = %10, %21
%17 = phi i8* [ %22, %21 ], [ %4, %10 ]
%18 = load i8, i8* %17
switch i8 %18, label %23 [
i8 32, label %19
i8 10, label %35
i8 0, label %35
]
19: ; preds = %16
%20 = getelementptr inbounds i8, i8* %17, i64 1
br label %21
21: ; preds = %19, %29
%22 = phi i8* [ %20, %19 ], [ %31, %29 ]
br label %16
23: ; preds = %16, %26
%24 = phi i8 [ %28, %26 ], [ %18, %16 ]
%25 = phi i8* [ %27, %26 ], [ %17, %16 ]
switch i8 %24, label %26 [
i8 32, label %29
i8 10, label %29
i8 0, label %29
]
26: ; preds = %23
%27 = getelementptr inbounds i8, i8* %25, i64 1
%28 = load i8, i8* %27
br label %23
29: ; preds = %23, %23, %23
store i8 0, i8* %25
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %17)
%31 = getelementptr inbounds i8, i8* %25, i64 1
%32 = ptrtoint i8* %31 to i64
%33 = sub i64 %32, %9
%34 = icmp slt i64 %33, %14
br i1 %34, label %21, label %35
35: ; preds = %29, %16, %16, %10
%36 = load i32, i32* @stdin
%37 = call i32* @fgets(i8* %4, i32 32767, i32 %36)
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %10
39: ; preds = %35, %2
ret i32 0
}