#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 /*<<< orphan*/ dumpx(int);
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main(int argc, char **argv) {
  int c;
  int l;
  int i;
  int n = 1;
  (void)argv;
  (void)argc;
  while ((l = getchar()) != EOF) {
    printf("%d\n", n);
    n++;
    dumpx(l);
    for (i = 0; i < l - 1 && (c = getchar()) != EOF; ++i) {
      if (i % 16 == 0) {
        putchar('\n');
      }
      dumpx(c);
    }
    putchar('\n');
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x18(%rbp)
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%eax
je     1229 <main+0xe9>
mov    -0x20(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <dumpx@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x21(%rbp)
jge    11cc <main+0x8c>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e24(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    11dc <main+0x9c>
jmp    1210 <main+0xd0>
mov    -0x1c(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11fa <main+0xba>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%edi
call   1060 <dumpx@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119d <main+0x5d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    115d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e8f(%rip),%r12
cmp    (%r12),%eax
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r13d
mov    $0x1,%r15d
lea    0xe80(%rip),%r14
jmp    11b8 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r15d
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%r13d
cmp    (%r12),%eax
je     115f <main+0x1f>
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <printf@plt>
mov    %r13d,%edi
call   1060 <dumpx@plt>
cmp    $0x2,%r13d
jl     1190 <main+0x50>
add    $0xffffffff,%r13d
xor    %ebp,%ebp
jmp    11ef <main+0xaf>
nopl   0x0(%rax)
mov    %ebx,%edi
call   1060 <dumpx@plt>
add    $0x1,%ebp
cmp    %ebp,%r13d
je     1190 <main+0x50>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r12),%eax
je     1190 <main+0x50>
mov    %eax,%ebx
test   $0xf,%bpl
jne    11e0 <main+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11e0 <main+0xa0>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %9
%10 = load i8**, i8*** %5
%11 = load i32, i32* %4
br label %12
12: ; preds = %46, %2
%13 = call i32 (...) @getchar()
store i32 %13, i32* %7
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %49
16: ; preds = %12
%17 = load i32, i32* %9
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %9
%20 = add nsw i32 %19, 1
store i32 %20, i32* %9
%21 = load i32, i32* %7
%22 = call i32 @dumpx(i32 %21)
store i32 0, i32* %8
br label %23
23: ; preds = %43, %16
%24 = load i32, i32* %8
%25 = load i32, i32* %7
%26 = sub nsw i32 %25, 1
%27 = icmp slt i32 %24, %26
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = call i32 (...) @getchar()
store i32 %29, i32* %6
%30 = load i32, i32* @EOF
%31 = icmp ne i32 %29, %30
br label %32
32: ; preds = %28, %23
%33 = phi i1 [ false, %23 ], [ %31, %28 ]
br i1 %33, label %34, label %46
34: ; preds = %32
%35 = load i32, i32* %8
%36 = srem i32 %35, 16
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @putchar(i8 signext 10)
br label %40
40: ; preds = %38, %34
%41 = load i32, i32* %6
%42 = call i32 @dumpx(i32 %41)
br label %43
43: ; preds = %40
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %23
46: ; preds = %32
%47 = call i32 @putchar(i8 signext 10)
%48 = call i32 @putchar(i8 signext 10)
br label %12
49: ; preds = %12
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %34, label %6
6: ; preds = %2, %28
%7 = phi i32 [ %31, %28 ], [ %3, %2 ]
%8 = phi i32 [ %10, %28 ], [ 1, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = tail call i32 @dumpx(i32 %7)
%12 = add i32 %7, -1
%13 = icmp sgt i32 %7, 1
br i1 %13, label %14, label %28
14: ; preds = %6, %24
%15 = phi i32 [ %26, %24 ], [ 0, %6 ]
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %28, label %19
19: ; preds = %14
%20 = and i32 %15, 15
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @putchar(i8 signext 10)
br label %24
24: ; preds = %22, %19
%25 = tail call i32 @dumpx(i32 %16)
%26 = add nuw nsw i32 %15, 1
%27 = icmp eq i32 %26, %12
br i1 %27, label %28, label %14
28: ; preds = %14, %24, %6
%29 = tail call i32 @putchar(i8 signext 10)
%30 = tail call i32 @putchar(i8 signext 10)
%31 = tail call i32 (...) @getchar()
%32 = load i32, i32* @EOF
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %6
34: ; preds = %28, %2
ret i32 0
}