#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int dump_header(void) {
  int acyl, asid, lcyl, lsid, lsec, llen, c, count;
  acyl = getchar();
  if (acyl == EOF)
    return -1;
  asid = getchar();
  if (asid == EOF)
    return -1;
  lcyl = getchar();
  if (lcyl == EOF)
    return -1;
  lsid = getchar();
  if (lsid == EOF)
    return -1;
  lsec = getchar();
  if (lsec == EOF)
    return -1;
  llen = getchar();
  if (llen == EOF)
    return -1;
  c = getchar();
  if (c == EOF)
    return -1;
  count = c;
  c = getchar();
  if (c == EOF)
    return -1;
  count |= (c << 8);
  printf("H/C/S: %d/%d/%d\n", lsid, lcyl, lsec);
  printf("+------+------+------+------+------+------+-----------+\n");
  printf("| acyl | asid | lcyl | lsid | lsec | llen |     count |\n");
  printf("|  %3d |  %3d |  %3d |  %3d |  %3d |  %3d | %9d |\n", acyl, asid,
         lcyl, lsid, lsec, llen, count);
  printf("+------+------+------+------+------+------+-----------+\n");
  return count;
}


x86 assembly (clang, -O0):
<dump_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
jne    1150 <dump_header+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%eax
jne    1178 <dump_header+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e5c(%rip),%rcx
cmp    (%rcx),%eax
jne    11a0 <dump_header+0x80>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e34(%rip),%rcx
cmp    (%rcx),%eax
jne    11c8 <dump_header+0xa8>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2e0c(%rip),%rcx
cmp    (%rcx),%eax
jne    11f0 <dump_header+0xd0>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2de4(%rip),%rcx
cmp    (%rcx),%eax
jne    1218 <dump_header+0xf8>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2dbc(%rip),%rcx
cmp    (%rcx),%eax
jne    1240 <dump_header+0x120>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2d8e(%rip),%rcx
cmp    (%rcx),%eax
jne    126e <dump_header+0x14e>
movl   $0xffffffff,-0x4(%rbp)
jmp    12ef <dump_header+0x1cf>
mov    -0x20(%rbp),%eax
shl    $0x8,%eax
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    -0x24(%rbp),%eax
lea    0xdb7(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_header>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e9c(%rip),%r13
mov    $0xffffffff,%ebp
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,%r15d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,%r12d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,0xc(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
mov    %eax,0x8(%rsp)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    0x0(%r13),%eax
je     1257 <dump_header+0x127>
shl    $0x8,%eax
or     0x8(%rsp),%eax
lea    0xe0c(%rip),%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    0xc(%rsp),%ebp
mov    %ebp,%ecx
mov    %rax,%r13
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe27(%rip),%rdi
call   1030 <puts@plt>
lea    0xde8(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
mov    %ebp,%r9d
xor    %eax,%eax
push   %r13
push   0x18(%rsp)
call   1040 <printf@plt>
add    $0x10,%rsp
lea    0xe2d(%rip),%rdi
call   1030 <puts@plt>
mov    %r13d,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [17 x i8] c"H/C/S: %d/%d/%d\0A\00"
@.str.1 = [57 x i8] c"+------+------+------+------+------+------+-----------+\0A\00"
@.str.2 = [57 x i8] c"| acyl | asid | lcyl | lsid | lsec | llen | count |\0A\00"
@.str.3 = [51 x i8] c"| %3d | %3d | %3d | %3d | %3d | %3d | %9d |\0A\00"
define i32 @dump_header() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = call i32 (...) @getchar()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %0
store i32 -1, i32* %1
br label %79
15: ; preds = %0
%16 = call i32 (...) @getchar()
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 -1, i32* %1
br label %79
21: ; preds = %15
%22 = call i32 (...) @getchar()
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 -1, i32* %1
br label %79
27: ; preds = %21
%28 = call i32 (...) @getchar()
store i32 %28, i32* %5
%29 = load i32, i32* %5
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 -1, i32* %1
br label %79
33: ; preds = %27
%34 = call i32 (...) @getchar()
store i32 %34, i32* %6
%35 = load i32, i32* %6
%36 = load i32, i32* @EOF
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %39
38: ; preds = %33
store i32 -1, i32* %1
br label %79
39: ; preds = %33
%40 = call i32 (...) @getchar()
store i32 %40, i32* %7
%41 = load i32, i32* %7
%42 = load i32, i32* @EOF
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %45
44: ; preds = %39
store i32 -1, i32* %1
br label %79
45: ; preds = %39
%46 = call i32 (...) @getchar()
store i32 %46, i32* %8
%47 = load i32, i32* %8
%48 = load i32, i32* @EOF
%49 = icmp eq i32 %47, %48
br i1 %49, label %50, label %51
50: ; preds = %45
store i32 -1, i32* %1
br label %79
51: ; preds = %45
%52 = load i32, i32* %8
store i32 %52, i32* %9
%53 = call i32 (...) @getchar()
store i32 %53, i32* %8
%54 = load i32, i32* %8
%55 = load i32, i32* @EOF
%56 = icmp eq i32 %54, %55
br i1 %56, label %57, label %58
57: ; preds = %51
store i32 -1, i32* %1
br label %79
58: ; preds = %51
%59 = load i32, i32* %8
%60 = shl i32 %59, 8
%61 = load i32, i32* %9
%62 = or i32 %61, %60
store i32 %62, i32* %9
%63 = load i32, i32* %5
%64 = load i32, i32* %4
%65 = load i32, i32* %6
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %63, i32 %64, i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
%69 = load i32, i32* %2
%70 = load i32, i32* %3
%71 = load i32, i32* %4
%72 = load i32, i32* %5
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = load i32, i32* %9
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), i32 %69, i32 %70, i32 %71, i32 %72, i32 %73, i32 %74, i32 %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%78 = load i32, i32* %9
store i32 %78, i32* %1
br label %79
79: ; preds = %58, %57, %50, %44, %38, %32, %26, %20, %14
%80 = load i32, i32* %1
ret i32 %80
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [17 x i8] c"H/C/S: %d/%d/%d\0A\00"
@.str.3 = [51 x i8] c"| %3d | %3d | %3d | %3d | %3d | %3d | %9d |\0A\00"
@str.4 = [56 x i8] c"| acyl | asid | lcyl | lsid | lsec | llen | count |\00"
@str.5 = [56 x i8] c"+------+------+------+------+------+------+-----------+\00"
define i32 @dump_header() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %40, label %4
4: ; preds = %0
%5 = tail call i32 (...) @getchar()
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %40, label %8
8: ; preds = %4
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %40, label %12
12: ; preds = %8
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %40, label %16
16: ; preds = %12
%17 = tail call i32 (...) @getchar()
%18 = load i32, i32* @EOF
%19 = icmp eq i32 %17, %18
br i1 %19, label %40, label %20
20: ; preds = %16
%21 = tail call i32 (...) @getchar()
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %40, label %24
24: ; preds = %20
%25 = tail call i32 (...) @getchar()
%26 = load i32, i32* @EOF
%27 = icmp eq i32 %25, %26
br i1 %27, label %40, label %28
28: ; preds = %24
%29 = tail call i32 (...) @getchar()
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %40, label %32
32: ; preds = %28
%33 = shl i32 %29, 8
%34 = or i32 %33, %25
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %9, i32 %17)
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.5, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.4, i64 0, i64 0))
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0), i32 %1, i32 %5, i32 %9, i32 %13, i32 %17, i32 %21, i32 %34)
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.5, i64 0, i64 0))
br label %40
40: ; preds = %28, %24, %20, %16, %12, %8, %4, %0, %32
%41 = phi i32 [ %34, %32 ], [ -1, %0 ], [ -1, %4 ], [ -1, %8 ], [ -1, %12 ], [ -1, %16 ], [ -1, %20 ], [ -1, %24 ], [ -1, %28 ]
ret i32 %41
}