#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*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isspace(int);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main() {
  unsigned i;
  int c;
  FILE *fin, *fout;
  fin = fopen("input.txt", "r");
  fout = fopen("output.txt", "w");
  if (!fout && !fin) {
    fprintf(stderr, "File IO Error!\n");
    exit(5);
  }
  while (!feof(fin) && !ferror(fin) && !ferror(fout)) {
    i = 0;
    while (i < 60 && (c = getc(fin)) != EOF)
      if (!isspace(c)) {
        putc(c, fout);
        ++i;
      }
    fputc('\n', fout);
  }
  fclose(fin);
  fclose(fout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe4a(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe3f(%rip),%rdi
lea    0xe43(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1212 <main+0x72>
cmpq   $0x0,-0x18(%rbp)
jne    1212 <main+0x72>
mov    0x2dde(%rip),%rax
mov    (%rax),%edi
lea    0xe16(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x5,%edi
call   10b0 <exit@plt>
jmp    1217 <main+0x77>
mov    -0x18(%rbp),%rdi
call   1090 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    125d <main+0xbd>
mov    -0x18(%rbp),%rdi
call   1030 <ferror@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x21(%rbp)
jne    125d <main+0xbd>
mov    -0x20(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    126d <main+0xcd>
jmp    12ec <main+0x14c>
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x3c,-0x8(%rbp)
mov    %al,-0x22(%rbp)
jae    129e <main+0xfe>
mov    -0x18(%rbp),%rdi
call   10c0 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2d52(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    12ae <main+0x10e>
jmp    12d9 <main+0x139>
mov    -0xc(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
jne    12d4 <main+0x134>
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1070 <putc@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1274 <main+0xd4>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1060 <fputc@plt>
jmp    1217 <main+0x77>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xe51(%rip),%rdi
lea    0xe54(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
lea    0xe47(%rip),%rdi
lea    0xe4b(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
mov    %r12,%rax
or     %r14,%rax
je     127e <main+0xde>
mov    %r12,%rdi
call   1090 <feof@plt>
test   %eax,%eax
je     1207 <main+0x67>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dda(%rip),%r15
jmp    1229 <main+0x89>
mov    $0xa,%edi
mov    %r14,%rsi
call   1060 <fputc@plt>
mov    %r12,%rdi
call   1090 <feof@plt>
test   %eax,%eax
jne    11ec <main+0x4c>
mov    %r12,%rdi
call   1030 <ferror@plt>
test   %eax,%eax
jne    11ec <main+0x4c>
mov    %r14,%rdi
call   1030 <ferror@plt>
test   %eax,%eax
jne    11ec <main+0x4c>
xor    %ebx,%ebx
jmp    1255 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x3c,%ebx
jae    1210 <main+0x70>
mov    %r12,%rdi
call   10c0 <getc@plt>
cmp    (%r15),%eax
je     1210 <main+0x70>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    1250 <main+0xb0>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <putc@plt>
add    $0x1,%ebx
jmp    1250 <main+0xb0>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
lea    0xd8b(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x5,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.4 = [16 x i8] c"File IO Error!\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %4
%7 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %17, label %10
10: ; preds = %0
%11 = load i32*, i32** %4
%12 = icmp ne i32* %11, null
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @exit(i32 5)
unreachable
17: ; preds = %10, %0
br label %18
18: ; preds = %55, %17
%19 = load i32*, i32** %4
%20 = call i32 @feof(i32* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %31, label %22
22: ; preds = %18
%23 = load i32*, i32** %4
%24 = call i32 @ferror(i32* %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = load i32*, i32** %5
%28 = call i32 @ferror(i32* %27)
%29 = icmp ne i32 %28, 0
%30 = xor i1 %29, true
br label %31
31: ; preds = %26, %22, %18
%32 = phi i1 [ false, %22 ], [ false, %18 ], [ %30, %26 ]
br i1 %32, label %33, label %58
33: ; preds = %31
store i32 0, i32* %2
br label %34
34: ; preds = %54, %33
%35 = load i32, i32* %2
%36 = icmp ult i32 %35, 60
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i32*, i32** %4
%39 = call i32 @getc(i32* %38)
store i32 %39, i32* %3
%40 = load i32, i32* @EOF
%41 = icmp ne i32 %39, %40
br label %42
42: ; preds = %37, %34
%43 = phi i1 [ false, %34 ], [ %41, %37 ]
br i1 %43, label %44, label %55
44: ; preds = %42
%45 = load i32, i32* %3
%46 = call i32 @isspace(i32 %45)
%47 = icmp ne i32 %46, 0
br i1 %47, label %54, label %48
48: ; preds = %44
%49 = load i32, i32* %3
%50 = load i32*, i32** %5
%51 = call i32 @putc(i32 %49, i32* %50)
%52 = load i32, i32* %2
%53 = add i32 %52, 1
store i32 %53, i32* %2
br label %54
54: ; preds = %48, %44
br label %34
55: ; preds = %42
%56 = load i32*, i32** %5
%57 = call i32 @fputc(i8 signext 10, i32* %56)
br label %18
58: ; preds = %31
%59 = load i32*, i32** %4
%60 = call i32 @fclose(i32* %59)
%61 = load i32*, i32** %5
%62 = call i32 @fclose(i32* %61)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"output.txt\00"
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.4 = [16 x i8] c"File IO Error!\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = icmp ne i32* %1, null
%5 = or i1 %4, %3
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @feof(i32* %1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %37
9: ; preds = %0
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @exit(i32 5)
unreachable
13: ; preds = %6, %33
%14 = tail call i32 @ferror(i32* %1)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %37
16: ; preds = %13
%17 = tail call i32 @ferror(i32* %2)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %16, %30
%20 = phi i32 [ %31, %30 ], [ 0, %16 ]
%21 = tail call i32 @getc(i32* %1)
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %33, label %24
24: ; preds = %19
%25 = tail call i32 @isspace(i32 %21)
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = tail call i32 @putc(i32 %21, i32* %2)
%29 = add nuw nsw i32 %20, 1
br label %30
30: ; preds = %27, %24
%31 = phi i32 [ %20, %24 ], [ %29, %27 ]
%32 = icmp ult i32 %31, 60
br i1 %32, label %19, label %33
33: ; preds = %30, %19
%34 = tail call i32 @fputc(i8 signext 10, i32* %2)
%35 = tail call i32 @feof(i32* %1)
%36 = icmp eq i32 %35, 0
br i1 %36, label %13, label %37
37: ; preds = %16, %13, %33, %6
%38 = tail call i32 @fclose(i32* %1)
%39 = tail call i32 @fclose(i32* %2)
ret i32 0
}