#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(void) {
  unsigned int i;
  int c;
  if ((c = getchar()) == -1) {
    fprintf(stderr, "Error: Not enough data.\n");
    return 1;
  }
  i = c % 256;
  if ((c = getchar()) == -1) {
    fprintf(stderr, "Error: Not enough data.\n");
    return 1;
  }
  i = c * 256 + i;
  while (i--) {
    if ((c = getchar()) == -1) {
      fprintf(stderr, "Error: Not enough data.\n");
      return 1;
    }
    putchar(c);
  }
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1183 <main+0x43>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    11c5 <main+0x85>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
lea    0xe4c(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1226 <main+0xe6>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1219 <main+0xd9>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
lea    0xdf8(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    123b <main+0xfb>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    11d1 <main+0x91>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     11ac <main+0x6c>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     11ac <main+0x6c>
mov    %eax,%ebx
lea    0xff(%r14),%eax
test   %r14d,%r14d
cmovns %r14d,%eax
and    $0xffffff00,%eax
sub    %eax,%r14d
shl    $0x8,%ebx
add    %r14d,%ebx
je     119a <main+0x5a>
nop
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     11ac <main+0x6c>
add    $0xffffffff,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jne    1180 <main+0x40>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
jmp    11c6 <main+0x86>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0xe44(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Error: Not enough data.\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @getchar()
store i32 %4, i32* %3
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %38
9: ; preds = %0
%10 = load i32, i32* %3
%11 = srem i32 %10, 256
store i32 %11, i32* %2
%12 = call i32 (...) @getchar()
store i32 %12, i32* %3
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %38
17: ; preds = %9
%18 = load i32, i32* %3
%19 = mul nsw i32 %18, 256
%20 = load i32, i32* %2
%21 = add i32 %19, %20
store i32 %21, i32* %2
br label %22
22: ; preds = %32, %17
%23 = load i32, i32* %2
%24 = add i32 %23, -1
store i32 %24, i32* %2
%25 = icmp ne i32 %23, 0
br i1 %25, label %26, label %35
26: ; preds = %22
%27 = call i32 (...) @getchar()
store i32 %27, i32* %3
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %38
32: ; preds = %26
%33 = load i32, i32* %3
%34 = call i32 @putchar(i32 %33)
br label %22
35: ; preds = %22
%36 = load i32, i32* @stdout
%37 = call i32 @fflush(i32 %36)
store i32 0, i32* %1
br label %38
38: ; preds = %35, %29, %14, %6
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Error: Not enough data.\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %31
6: ; preds = %0
%7 = tail call i32 (...) @getchar()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %31
12: ; preds = %6
%13 = srem i32 %1, 256
%14 = shl nsw i32 %7, 8
%15 = add i32 %14, %13
%16 = icmp eq i32 %15, 0
br i1 %16, label %28, label %17
17: ; preds = %12, %25
%18 = phi i32 [ %19, %25 ], [ %15, %12 ]
%19 = add i32 %18, -1
%20 = tail call i32 (...) @getchar()
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %31
25: ; preds = %17
%26 = tail call i32 @putchar(i32 %20)
%27 = icmp eq i32 %19, 0
br i1 %27, label %28, label %17
28: ; preds = %25, %12
%29 = load i32, i32* @stdout
%30 = tail call i32 @fflush(i32 %29)
br label %31
31: ; preds = %28, %22, %9, %3
%32 = phi i32 [ 1, %3 ], [ 1, %9 ], [ 1, %22 ], [ 0, %28 ]
ret i32 %32
}