#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*/ feof(int /*<<< orphan*/);
unsigned char getchar();
int /*<<< orphan*/ putchar(unsigned char);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  while (!feof(stdin)) {
    int count, savecount;
    unsigned char ch;
    ch = getchar();
    count = ch;
    ch = getchar();
    count += ch << 8;
    savecount = count;
    while (count-- > 0) {
      ch = getchar();
      putchar(ch);
    }
    if (savecount & 1) {
      getchar();
    }
  }
}


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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1169 <main+0x39>
jmp    11de <main+0xae>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
shl    $0x8,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    11c3 <main+0x93>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%edi
call   1030 <putchar@plt>
jmp    1197 <main+0x67>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11d9 <main+0xa9>
mov    $0x0,%al
call   1040 <getchar@plt>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x2eaa(%rip),%r14
xchg   %ax,%ax
mov    (%r14),%edi
call   1050 <feof@plt>
test   %eax,%eax
jne    1196 <main+0x66>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%r15d
movzbl %al,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
movzbl %al,%ebp
shl    $0x8,%ebp
or     %ebx,%ebp
je     1187 <main+0x57>
add    $0x1,%ebp
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movzbl %al,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1170 <main+0x40>
test   $0x1,%r15b
je     1140 <main+0x10>
xor    %eax,%eax
call   1040 <getchar@plt>
jmp    1140 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %9
9: ; preds = %39, %2
%10 = load i32, i32* @stdin
%11 = call i32 @feof(i32 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %40
14: ; preds = %9
%15 = call zeroext i8 (...) @getchar()
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
store i32 %17, i32* %6
%18 = call zeroext i8 (...) @getchar()
store i8 %18, i8* %8
%19 = load i8, i8* %8
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = load i32, i32* %6
%23 = add nsw i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %6
store i32 %24, i32* %7
br label %25
25: ; preds = %29, %14
%26 = load i32, i32* %6
%27 = add nsw i32 %26, -1
store i32 %27, i32* %6
%28 = icmp sgt i32 %26, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = call zeroext i8 (...) @getchar()
store i8 %30, i8* %8
%31 = load i8, i8* %8
%32 = call i32 @putchar(i8 zeroext %31)
br label %25
33: ; preds = %25
%34 = load i32, i32* %7
%35 = and i32 %34, 1
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call zeroext i8 (...) @getchar()
br label %39
39: ; preds = %37, %33
br label %9
40: ; preds = %9
%41 = load i32, i32* %3
ret i32 %41
}

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 %29
6: ; preds = %2, %25
%7 = tail call zeroext i8 (...) @getchar()
%8 = zext i8 %7 to i32
%9 = tail call zeroext i8 (...) @getchar()
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 8
%12 = or i32 %11, %8
%13 = icmp eq i32 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %6, %14
%15 = phi i32 [ %16, %14 ], [ %12, %6 ]
%16 = add nsw i32 %15, -1
%17 = tail call zeroext i8 (...) @getchar()
%18 = tail call i32 @putchar(i8 zeroext %17)
%19 = icmp sgt i32 %15, 1
br i1 %19, label %14, label %20
20: ; preds = %14, %6
%21 = and i32 %8, 1
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call zeroext i8 (...) @getchar()
br label %25
25: ; preds = %23, %20
%26 = load i32, i32* @stdin
%27 = tail call i32 @feof(i32 %26)
%28 = icmp eq i32 %27, 0
br i1 %28, label %6, label %29
29: ; preds = %25, %2
ret i32 0
}