#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 EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned char);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void dumpBytes(FILE *f) {
  int j = 0, i, k, b;
  unsigned char buf[16];
  for (;;) {
    printf("%03X0: ", j);
    ++j;
    for (i = 0; i < 16; ++i) {
      b = fgetc(f);
      if (b == EOF)
        break;
      printf("%02x ", buf[i] = (unsigned char)b);
      if (i == 7)
        putchar(' ');
    }
    if (b == EOF) {
      for (k = i; k < 16; ++k) {
        if (k == 7)
          putchar(' ');
        { fputs("   ", stdout); };
      }
    }
    { fputs("   ", stdout); };
    for (k = 0; k < i; ++k) {
      if ((buf[k] > 31) && (buf[k] < 128))
        putchar(buf[k]);
      else
        putchar('.');
      if (k == 7)
        putchar(' ');
    }
    putchar('\n');
    if (b == EOF)
      break;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<dumpBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
lea    0xea3(%rip),%rdi
movzbl %al,%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    11e3 <dumpBytes+0xa3>
mov    -0x8(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2e53(%rip),%rcx
cmp    (%rcx),%eax
jne    11a2 <dumpBytes+0x62>
jmp    11e3 <dumpBytes+0xa3>
mov    -0x18(%rbp),%eax
movslq -0x10(%rbp),%rcx
mov    %al,-0x30(%rbp,%rcx,1)
lea    0xe54(%rip),%rdi
movzbl %al,%esi
call   1040 <printf@plt>
cmpl   $0x7,-0x10(%rbp)
jne    11d0 <dumpBytes+0x90>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11d5 <dumpBytes+0x95>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1175 <dumpBytes+0x35>
mov    -0x18(%rbp),%eax
mov    0x2dfb(%rip),%rcx
cmp    (%rcx),%eax
jne    1241 <dumpBytes+0x101>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    123c <dumpBytes+0xfc>
cmpl   $0x7,-0x14(%rbp)
jne    1219 <dumpBytes+0xd9>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x2db8(%rip),%rax
mov    (%rax),%esi
lea    0xde5(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11fb <dumpBytes+0xbb>
jmp    1241 <dumpBytes+0x101>
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
lea    0xdbd(%rip),%rdi
call   1050 <fputs@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12d3 <dumpBytes+0x193>
movslq -0x14(%rbp),%rax
movzbl -0x30(%rbp,%rax,1),%eax
cmp    $0x1f,%eax
jle    12a2 <dumpBytes+0x162>
movslq -0x14(%rbp),%rax
movzbl -0x30(%rbp,%rax,1),%eax
cmp    $0x80,%eax
jge    12a2 <dumpBytes+0x162>
movslq -0x14(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1030 <putchar@plt>
jmp    12ac <dumpBytes+0x16c>
mov    $0x2e,%edi
call   1030 <putchar@plt>
cmpl   $0x7,-0x14(%rbp)
jne    12c0 <dumpBytes+0x180>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    12c5 <dumpBytes+0x185>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    125d <dumpBytes+0x11d>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
mov    0x2d01(%rip),%rcx
cmp    (%rcx),%eax
jne    12f4 <dumpBytes+0x1b4>
jmp    12f9 <dumpBytes+0x1b9>
jmp    1153 <dumpBytes+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpBytes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
xor    %ebx,%ebx
mov    $0x2e,%r13d
jmp    117e <dumpBytes+0x3e>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e77(%rip),%rax
cmp    (%rax),%ebp
mov    0x8(%rsp),%rbx
je     12a2 <dumpBytes+0x162>
movzbl %bl,%esi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
add    $0x1,%ebx
mov    $0x10,%r12d
xor    %r15d,%r15d
mov    %rbx,0x8(%rsp)
jmp    11b2 <dumpBytes+0x72>
add    $0x1,%r15
add    $0xffffffff,%r12d
cmp    $0x10,%r15
je     1250 <dumpBytes+0x110>
mov    %r14,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
mov    0x2e25(%rip),%rax
cmp    (%rax),%ebp
je     11f0 <dumpBytes+0xb0>
mov    %bpl,0x10(%rsp,%r15,1)
movzbl %bpl,%esi
lea    0xe31(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x7,%r15
jne    11a0 <dumpBytes+0x60>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11a0 <dumpBytes+0x60>
xchg   %ax,%ax
cmp    $0xf,%r15d
mov    0x2ddd(%rip),%rbx
jbe    1234 <dumpBytes+0xf4>
mov    (%rbx),%esi
lea    0xe08(%rip),%rdi
call   1050 <fputs@plt>
test   %r15d,%r15d
jne    126b <dumpBytes+0x12b>
jmp    1160 <dumpBytes+0x20>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%esi
lea    0xde5(%rip),%rdi
call   1050 <fputs@plt>
add    $0xffffffff,%r12d
je     11fd <dumpBytes+0xbd>
cmp    $0x9,%r12d
jne    1220 <dumpBytes+0xe0>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1220 <dumpBytes+0xe0>
cs nopw 0x0(%rax,%rax,1)
mov    0x2d81(%rip),%rax
mov    (%rax),%esi
lea    0xdae(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x10,%r15d
xor    %ebx,%ebx
jmp    127d <dumpBytes+0x13d>
nop
add    $0x1,%rbx
cmp    %rbx,%r15
je     1160 <dumpBytes+0x20>
movzbl 0x10(%rsp,%rbx,1),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    $0x7,%rbx
jne    1270 <dumpBytes+0x130>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1270 <dumpBytes+0x130>
mov    $0xa,%edi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%03X0: \00"
@EOF = global i32 0
@.str.1 = [6 x i8] c"%02x \00"
@.str.2 = [4 x i8] c" \00"
@stdout = global i32 0
define void @dumpBytes(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [16 x i8]
store i32* %0, i32** %2
store i32 0, i32* %3
br label %8
8: ; preds = %104, %1
%9 = load i32, i32* %3
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
store i32 0, i32* %4
br label %14
14: ; preds = %36, %8
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 16
br i1 %16, label %17, label %39
17: ; preds = %14
%18 = load i32*, i32** %2
%19 = call i32 @fgetc(i32* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %17
br label %39
24: ; preds = %17
%25 = load i32, i32* %6
%26 = trunc i32 %25 to i8
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %28
store i8 %26, i8* %29
%30 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %26)
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 7
br i1 %32, label %33, label %35
33: ; preds = %24
%34 = call i32 @putchar(i8 signext 32)
br label %35
35: ; preds = %33, %24
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %14
39: ; preds = %23, %14
%40 = load i32, i32* %6
%41 = load i32, i32* @EOF
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %60
43: ; preds = %39
%44 = load i32, i32* %4
store i32 %44, i32* %5
br label %45
45: ; preds = %56, %43
%46 = load i32, i32* %5
%47 = icmp slt i32 %46, 16
br i1 %47, label %48, label %59
48: ; preds = %45
%49 = load i32, i32* %5
%50 = icmp eq i32 %49, 7
br i1 %50, label %51, label %53
51: ; preds = %48
%52 = call i32 @putchar(i8 signext 32)
br label %53
53: ; preds = %51, %48
%54 = load i32, i32* @stdout
%55 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %53
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %45
59: ; preds = %45
br label %60
60: ; preds = %59, %39
%61 = load i32, i32* @stdout
%62 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %61)
store i32 0, i32* %5
br label %63
63: ; preds = %95, %60
%64 = load i32, i32* %5
%65 = load i32, i32* %4
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %98
67: ; preds = %63
%68 = load i32, i32* %5
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = icmp sgt i32 %72, 31
br i1 %73, label %74, label %87
74: ; preds = %67
%75 = load i32, i32* %5
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = icmp slt i32 %79, 128
br i1 %80, label %81, label %87
81: ; preds = %74
%82 = load i32, i32* %5
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = call i32 @putchar(i8 signext %85)
br label %89
87: ; preds = %74, %67
%88 = call i32 @putchar(i8 signext 46)
br label %89
89: ; preds = %87, %81
%90 = load i32, i32* %5
%91 = icmp eq i32 %90, 7
br i1 %91, label %92, label %94
92: ; preds = %89
%93 = call i32 @putchar(i8 signext 32)
br label %94
94: ; preds = %92, %89
br label %95
95: ; preds = %94
%96 = load i32, i32* %5
%97 = add nsw i32 %96, 1
store i32 %97, i32* %5
br label %63
98: ; preds = %63
%99 = call i32 @putchar(i8 signext 10)
%100 = load i32, i32* %6
%101 = load i32, i32* @EOF
%102 = icmp eq i32 %100, %101
br i1 %102, label %103, label %104
103: ; preds = %98
br label %105
104: ; preds = %98
br label %8
105: ; preds = %103
%106 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%03X0: \00"
@EOF = global i32 0
@.str.1 = [6 x i8] c"%02x \00"
@.str.2 = [4 x i8] c" \00"
@stdout = global i32 0
define void @dumpBytes(i32* nocapture %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %60, %1
%5 = phi i32 [ 0, %1 ], [ %8, %60 ]
%6 = trunc i32 %5 to i8
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
%8 = add nuw nsw i32 %5, 1
br label %9
9: ; preds = %4, %21
%10 = phi i64 [ 0, %4 ], [ %22, %21 ]
%11 = tail call i32 @fgetc(i32* %0)
%12 = load i32, i32* @EOF
%13 = icmp eq i32 %11, %12
br i1 %13, label %27, label %14
14: ; preds = %9
%15 = trunc i32 %11 to i8
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %10
store i8 %15, i8* %16
%17 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %15)
%18 = icmp eq i64 %10, 7
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @putchar(i8 signext 32)
br label %21
21: ; preds = %14, %19
%22 = add nuw nsw i64 %10, 1
%23 = icmp eq i64 %22, 16
br i1 %23, label %24, label %9
24: ; preds = %21
%25 = load i32, i32* @stdout
%26 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %44
27: ; preds = %9
%28 = trunc i64 %10 to i32
%29 = icmp ult i32 %28, 16
br i1 %29, label %30, label %40
30: ; preds = %27, %35
%31 = phi i32 [ %38, %35 ], [ %28, %27 ]
%32 = icmp eq i32 %31, 7
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @putchar(i8 signext 32)
br label %35
35: ; preds = %33, %30
%36 = load i32, i32* @stdout
%37 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = add nuw nsw i32 %31, 1
%39 = icmp eq i32 %38, 16
br i1 %39, label %40, label %30
40: ; preds = %35, %27
%41 = load i32, i32* @stdout
%42 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = icmp eq i32 %28, 0
br i1 %43, label %60, label %44
44: ; preds = %24, %40
%45 = phi i64 [ 16, %24 ], [ %10, %40 ]
%46 = and i64 %45, 4294967295
br label %47
47: ; preds = %44, %57
%48 = phi i64 [ 0, %44 ], [ %58, %57 ]
%49 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = icmp sgt i8 %50, 31
%52 = select i1 %51, i8 %50, i8 46
%53 = tail call i32 @putchar(i8 signext %52)
%54 = icmp eq i64 %48, 7
br i1 %54, label %55, label %57
55: ; preds = %47
%56 = tail call i32 @putchar(i8 signext 32)
br label %57
57: ; preds = %47, %55
%58 = add nuw nsw i64 %48, 1
%59 = icmp eq i64 %58, %46
br i1 %59, label %60, label %47
60: ; preds = %57, %40
%61 = tail call i32 @putchar(i8 signext 10)
%62 = load i32, i32* @EOF
%63 = icmp eq i32 %11, %62
br i1 %63, label %64, label %4
64: ; preds = %60
%65 = tail call i32 @putchar(i8 signext 10)
ret void
}