#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
scalar_t__ isalnum(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
void printFile(FILE *output) {
  char buffer = '@';
  int counter = 0;
  rewind(output);
  do {
    buffer = fgetc(output);
    if (buffer == '|') {
      printf(" |||| ");
    } else if (buffer == '\\') {
      printf("\n\n***\tREGISTER %d\t***\n\n", counter + 1);
    } else if (isalnum(buffer)) {
      printf("%c", buffer);
    }
    counter++;
  } while (!feof(output));
}


x86 assembly (clang, -O0):
<printFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x40,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
mov    -0x8(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x7c,%eax
jne    119c <printFile+0x4c>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f1 <printFile+0xa1>
movsbl -0x9(%rbp),%eax
cmp    $0x5c,%eax
jne    11c2 <printFile+0x72>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <printFile+0x9c>
movsbl -0x9(%rbp),%edi
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     11e7 <printFile+0x97>
movsbl -0x9(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <printFile+0x9c>
jmp    11f1 <printFile+0xa1>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1170 <printFile+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFile>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r12
call   1050 <rewind@plt>
mov    $0x1,%ebp
lea    0xe8b(%rip),%r14
lea    0xe7d(%rip),%r15
jmp    11ab <printFile+0x4b>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
call   1080 <feof@plt>
add    $0x1,%ebp
test   %eax,%eax
jne    11e8 <printFile+0x88>
mov    %r12,%rdi
call   1070 <fgetc@plt>
cmp    $0x5c,%al
je     1190 <printFile+0x30>
cmp    $0x7c,%al
jne    11d0 <printFile+0x70>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119c <printFile+0x3c>
nopw   0x0(%rax,%rax,1)
movsbl %al,%ebx
mov    %ebx,%edi
call   1060 <isalnum@plt>
test   %rax,%rax
je     119c <printFile+0x3c>
mov    %ebx,%edi
call   1030 <putchar@plt>
jmp    119c <printFile+0x3c>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" |||| \00"
@.str.1 = [24 x i8] c"\0A\0A***\09REGISTER %d\09***\0A\0A\00"
@.str.2 = [3 x i8] c"%c\00"
define void @printFile(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca i32
store i32* %0, i32** %2
store i8 64, i8* %3
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = call i32 @rewind(i32* %5)
br label %7
7: ; preds = %36, %1
%8 = load i32*, i32** %2
%9 = call signext i8 @fgetc(i32* %8)
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 124
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %33
15: ; preds = %7
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %32
23: ; preds = %15
%24 = load i8, i8* %3
%25 = call i64 @isalnum(i8 signext %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %27, %23
br label %32
32: ; preds = %31, %19
br label %33
33: ; preds = %32, %13
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %36
36: ; preds = %33
%37 = load i32*, i32** %2
%38 = call i32 @feof(i32* %37)
%39 = icmp ne i32 %38, 0
%40 = xor i1 %39, true
br i1 %40, label %7, label %41
41: ; preds = %36
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" |||| \00"
@.str.1 = [24 x i8] c"\0A\0A***\09REGISTER %d\09***\0A\0A\00"
define void @printFile(i32* nocapture %0) {
%2 = tail call i32 @rewind(i32* %0)
br label %3
3: ; preds = %17, %1
%4 = phi i32 [ 0, %1 ], [ %18, %17 ]
%5 = tail call signext i8 @fgetc(i32* %0)
%6 = sext i8 %5 to i32
switch i8 %5, label %12 [
i8 124, label %7
i8 92, label %9
]
7: ; preds = %3
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %17
9: ; preds = %3
%10 = add nuw nsw i32 %4, 1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %17
12: ; preds = %3
%13 = tail call i64 @isalnum(i8 signext %5)
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @putchar(i32 %6)
br label %17
17: ; preds = %9, %15, %12, %7
%18 = add nuw nsw i32 %4, 1
%19 = tail call i32 @feof(i32* %0)
%20 = icmp eq i32 %19, 0
br i1 %20, label %3, label %21
21: ; preds = %17
ret void
}