#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 EOF;
int getchar();
int /*<<< orphan*/ mprint(int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ shift(int, int, int *);
int main(void) {
  int col = 0;
  int sp = -1;
  int buff[20];
  while ((buff[col] = getchar()) != EOF) {
    if (buff[col] == '\n') {
      mprint(0, col + 1, buff);
      sp = -1;
      col = 0;
      continue;
    }
    if (buff[col] == ' ' || buff[col] == '\t') {
      sp = col;
    }
    col++;
    if (col == 20) {
      if (sp == -1) {
        mprint(0, 20, buff);
        putchar('\n');
        col = 0;
        sp = -1;
      } else {
        mprint(0, sp, buff);
        putchar('\n');
        shift(sp + 1, 20, buff);
        col = 20 - sp - 1;
        sp = -1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
movslq -0x8(%rbp),%rcx
mov    %eax,-0x60(%rbp,%rcx,4)
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%eax
je     1267 <main+0x127>
movslq -0x8(%rbp),%rax
cmpl   $0xa,-0x60(%rbp,%rax,4)
jne    11ae <main+0x6e>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    -0x60(%rbp),%rdx
xor    %edi,%edi
call   1040 <mprint@plt>
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    115d <main+0x1d>
movslq -0x8(%rbp),%rax
cmpl   $0x20,-0x60(%rbp,%rax,4)
je     11cc <main+0x8c>
movslq -0x8(%rbp),%rax
cmpl   $0x9,-0x60(%rbp,%rax,4)
jne    11d2 <main+0x92>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jne    1262 <main+0x122>
cmpl   $0xffffffff,-0xc(%rbp)
jne    121c <main+0xdc>
lea    -0x60(%rbp),%rdx
xor    %edi,%edi
mov    $0x14,%esi
call   1040 <mprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
jmp    125d <main+0x11d>
mov    -0xc(%rbp),%esi
lea    -0x60(%rbp),%rdx
xor    %edi,%edi
call   1040 <mprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
lea    -0x60(%rbp),%rdx
mov    $0x14,%esi
call   1060 <shift@plt>
mov    $0x14,%eax
sub    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
jmp    1262 <main+0x122>
jmp    115d <main+0x1d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x58,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,(%rsp)
mov    0x2e8d(%rip),%r15
cmp    (%r15),%eax
jne    116d <main+0x2d>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebx
mov    %rsp,%r14
xor    %ebp,%ebp
jmp    11a8 <main+0x68>
nopl   0x0(%rax)
add    $0x1,%ebp
xor    %edi,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <mprint@plt>
mov    $0xffffffff,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
movslq %ebp,%rcx
mov    %eax,(%rsp,%rcx,4)
cmp    (%r15),%eax
je     1160 <main+0x20>
cmp    $0x9,%eax
je     11c0 <main+0x80>
cmp    $0x20,%eax
je     11c0 <main+0x80>
cmp    $0xa,%eax
je     1180 <main+0x40>
jmp    11c2 <main+0x82>
nopl   0x0(%rax)
mov    %ebp,%ebx
add    $0x1,%ebp
cmp    $0x14,%ebp
jne    1196 <main+0x56>
cmp    $0xffffffff,%ebx
jne    11f1 <main+0xb1>
xor    %ebp,%ebp
xor    %edi,%edi
mov    $0x14,%esi
mov    %r14,%rdx
call   1040 <mprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%ebx
jmp    1196 <main+0x56>
xor    %edi,%edi
mov    %ebx,%esi
mov    %r14,%rdx
call   1040 <mprint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%edi
mov    $0x14,%esi
mov    %r14,%rdx
call   1060 <shift@plt>
mov    $0x13,%ebp
sub    %ebx,%ebp
mov    $0xffffffff,%ebx
jmp    1196 <main+0x56>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 -1, i32* %3
br label %5
5: ; preds = %62, %18, %0
%6 = call i32 (...) @getchar()
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %8
store i32 %6, i32* %9
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %6, %10
br i1 %11, label %12, label %63
12: ; preds = %5
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %23
18: ; preds = %12
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
%21 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%22 = call i32 @mprint(i32 0, i32 %20, i32* %21)
store i32 -1, i32* %3
store i32 0, i32* %2
br label %5
23: ; preds = %12
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 32
br i1 %28, label %35, label %29
29: ; preds = %23
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 9
br i1 %34, label %35, label %37
35: ; preds = %29, %23
%36 = load i32, i32* %2
store i32 %36, i32* %3
br label %37
37: ; preds = %35, %29
%38 = load i32, i32* %2
%39 = add nsw i32 %38, 1
store i32 %39, i32* %2
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 20
br i1 %41, label %42, label %62
42: ; preds = %37
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%47 = call i32 @mprint(i32 0, i32 20, i32* %46)
%48 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %2
store i32 -1, i32* %3
br label %61
49: ; preds = %42
%50 = load i32, i32* %3
%51 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%52 = call i32 @mprint(i32 0, i32 %50, i32* %51)
%53 = call i32 @putchar(i8 signext 10)
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
%56 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 0
%57 = call i32 @shift(i32 %55, i32 20, i32* %56)
%58 = load i32, i32* %3
%59 = sub nsw i32 20, %58
%60 = sub nsw i32 %59, 1
store i32 %60, i32* %2
store i32 -1, i32* %3
br label %61
61: ; preds = %49, %45
br label %62
62: ; preds = %61, %37
br label %5
63: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = call i32 (...) @getchar()
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
store i32 %3, i32* %4
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %3, %5
br i1 %6, label %38, label %7
7: ; preds = %0, %14
%8 = phi i32 [ %17, %14 ], [ %3, %0 ]
%9 = phi i32 [ %16, %14 ], [ -1, %0 ]
%10 = phi i32 [ %15, %14 ], [ 0, %0 ]
switch i32 %8, label %23 [
i32 10, label %11
i32 32, label %22
i32 9, label %22
]
11: ; preds = %7
%12 = add nsw i32 %10, 1
%13 = call i32 @mprint(i32 0, i32 %12, i32* %4)
br label %14
14: ; preds = %23, %32, %29, %11
%15 = phi i32 [ 0, %11 ], [ 0, %29 ], [ %37, %32 ], [ %25, %23 ]
%16 = phi i32 [ -1, %11 ], [ -1, %29 ], [ -1, %32 ], [ %24, %23 ]
%17 = call i32 (...) @getchar()
%18 = sext i32 %15 to i64
%19 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %18
store i32 %17, i32* %19
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %17, %20
br i1 %21, label %38, label %7
22: ; preds = %7, %7
br label %23
23: ; preds = %7, %22
%24 = phi i32 [ %10, %22 ], [ %9, %7 ]
%25 = add nsw i32 %10, 1
%26 = icmp eq i32 %25, 20
br i1 %26, label %27, label %14
27: ; preds = %23
%28 = icmp eq i32 %24, -1
br i1 %28, label %29, label %32
29: ; preds = %27
%30 = call i32 @mprint(i32 0, i32 20, i32* %4)
%31 = call i32 @putchar(i8 signext 10)
br label %14
32: ; preds = %27
%33 = call i32 @mprint(i32 0, i32 %24, i32* %4)
%34 = call i32 @putchar(i8 signext 10)
%35 = add nuw nsw i32 %24, 1
%36 = call i32 @shift(i32 %35, i32 20, i32* %4)
%37 = sub i32 19, %24
br label %14
38: ; preds = %14, %0
ret i32 0
}