#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 /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ ferror(int /*<<< orphan*/);
int /*<<< orphan*/ putchar_unlocked(char);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ transform_doc(int /*<<< orphan*/);
int main(int argc, char **argv) {
  while (!feof(stdin) && !ferror(stdin)) {
    transform_doc(0);
    putchar_unlocked('\n');
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    119d <main+0x4d>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1030 <ferror@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11ad <main+0x5d>
jmp    11c3 <main+0x73>
xor    %edi,%edi
call   1070 <transform_doc@plt>
mov    $0xa,%edi
call   1050 <putchar_unlocked@plt>
jmp    1166 <main+0x16>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e90(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1189 <main+0x39>
mov    (%rbx),%edi
call   1030 <ferror@plt>
test   %eax,%eax
jne    1189 <main+0x39>
xor    %edi,%edi
call   1070 <transform_doc@plt>
mov    $0xa,%edi
call   1050 <putchar_unlocked@plt>
jmp    1160 <main+0x10>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* @stdin
%8 = call i32 @feof(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* @stdin
%12 = call i32 @ferror(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ false, %6 ], [ %14, %10 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = call i32 @transform_doc(i32 0)
%19 = call i32 @putchar_unlocked(i8 signext 10)
br label %6
20: ; preds = %15
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @feof(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %2, %10
%7 = load i32, i32* @stdin
%8 = tail call i32 @ferror(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = tail call i32 @transform_doc(i32 0)
%12 = tail call i32 @putchar_unlocked(i8 signext 10)
%13 = load i32, i32* @stdin
%14 = tail call i32 @feof(i32 %13)
%15 = icmp eq i32 %14, 0
br i1 %15, label %6, label %16
16: ; preds = %6, %10, %2
%17 = tail call i32 @exit(i32 0)
unreachable
}