#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 count = 0, j, i, k, b;
  unsigned char buf[4];
  for (;;) {
    printf("%04X: ", count);
    count += 4;
    for (i = 0; i < 4; ++i) {
      b = fgetc(f);
      if (b == EOF)
        break;
      printf("%02x ", buf[i] = (unsigned char)b);
    }
    if (b == EOF) {
      for (k = i; k < 4; ++k) {
        { fputs("   ", stdout); };
      }
    }
    { fputs("   ", stdout); };
    for (k = 0; k < i; ++k) {
      b = buf[k];
      for (j = 0; j < 8; j++) {
        if (b & 0x80)
          putchar('1');
        else
          putchar('0');
        b <<= 1;
      }
      putchar(' ');
    }
    putchar('\n');
    if (b == EOF)
      break;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<dumpBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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    $0x4,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11ca <dumpBytes+0x8a>
mov    -0x8(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e53(%rip),%rcx
cmp    (%rcx),%eax
jne    11a2 <dumpBytes+0x62>
jmp    11ca <dumpBytes+0x8a>
mov    -0x1c(%rbp),%eax
movslq -0x14(%rbp),%rcx
mov    %al,-0x20(%rbp,%rcx,1)
lea    0xe53(%rip),%rdi
movzbl %al,%esi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <dumpBytes+0x35>
mov    -0x1c(%rbp),%eax
mov    0x2e14(%rip),%rcx
cmp    (%rcx),%eax
jne    1214 <dumpBytes+0xd4>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    120f <dumpBytes+0xcf>
mov    0x2de5(%rip),%rax
mov    (%rax),%esi
lea    0xe11(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11e2 <dumpBytes+0xa2>
jmp    1214 <dumpBytes+0xd4>
mov    0x2dbd(%rip),%rax
mov    (%rax),%esi
lea    0xde9(%rip),%rdi
call   1050 <fputs@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12b2 <dumpBytes+0x172>
movslq -0x18(%rbp),%rax
movzbl -0x20(%rbp,%rax,1),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    129a <dumpBytes+0x15a>
mov    -0x1c(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1279 <dumpBytes+0x139>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    1283 <dumpBytes+0x143>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    124f <dumpBytes+0x10f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1230 <dumpBytes+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
mov    0x2d22(%rip),%rcx
cmp    (%rcx),%eax
jne    12d3 <dumpBytes+0x193>
jmp    12d8 <dumpBytes+0x198>
jmp    1153 <dumpBytes+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpBytes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbp
xor    %r12d,%r12d
mov    0x2e8d(%rip),%r13
mov    %rdi,0x20(%rsp)
jmp    1188 <dumpBytes+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x4,%r12d
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x0(%r13),%r15d
je     1419 <dumpBytes+0x2d9>
movzbl %r12b,%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
mov    $0x1,%r14b
cmp    0x0(%r13),%eax
jne    11c0 <dumpBytes+0x80>
mov    %rbp,%r13
mov    %eax,%r15d
xor    %ebx,%ebx
jmp    1263 <dumpBytes+0x123>
cs nopw 0x0(%rax,%rax,1)
mov    %al,0x10(%rsp)
movzbl %al,%esi
lea    0xe59(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
cmp    0x0(%r13),%eax
jne    1200 <dumpBytes+0xc0>
mov    %rbp,%r13
mov    %eax,%r15d
mov    $0x1,%ebx
jmp    1260 <dumpBytes+0x120>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %al,0x11(%rsp)
movzbl %al,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
cmp    0x0(%r13),%eax
jne    122a <dumpBytes+0xea>
mov    %rbp,%r13
mov    %eax,%r15d
mov    $0x2,%ebx
jmp    1260 <dumpBytes+0x120>
mov    %al,0x12(%rsp)
movzbl %al,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbp,%rdi
call   1060 <fgetc@plt>
cmp    0x0(%r13),%eax
jne    13eb <dumpBytes+0x2ab>
mov    %rbp,%r13
mov    %eax,%r15d
mov    $0x3,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %r14d,%r14d
mov    0x2d6e(%rip),%rax
mov    $0x4,%ebp
nop
mov    (%rax),%esi
lea    0xdb4(%rip),%rdi
call   1050 <fputs@plt>
lea    0xda8(%rip),%rdi
mov    0x2d4c(%rip),%rax
add    $0xffffffff,%ebp
cmp    %ebp,%ebx
jne    1270 <dumpBytes+0x130>
mov    (%rax),%esi
call   1050 <fputs@plt>
test   %r14b,%r14b
mov    %r13,%rbp
mov    0x2d41(%rip),%r13
jne    1170 <dumpBytes+0x30>
mov    %r12,0x28(%rsp)
mov    %ebx,%eax
mov    %rax,0x30(%rsp)
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,0x18(%rsp)
mov    0x18(%rsp),%rax
movzbl 0x10(%rsp,%rax,1),%eax
mov    %eax,0x14(%rsp)
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xd18(%rip),%xmm1
pand   0xd20(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebx
mov    %ebx,%eax
and    $0x2,%al
shr    %al
mov    %al,0xf(%rsp)
mov    %ebx,%r13d
and    $0x4,%r13b
shr    $0x2,%r13b
mov    %ebx,%r15d
and    $0x8,%r15b
shr    $0x3,%r15b
mov    %ebx,%ebp
and    $0x10,%bpl
shr    $0x4,%bpl
mov    %ebx,%r12d
and    $0x20,%r12b
shr    $0x5,%r12b
mov    %ebx,%r14d
and    $0x40,%r14b
shr    $0x6,%r14b
mov    %ebx,%eax
shr    $0x7,%al
movzbl %al,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl %r14b,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl %r12b,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl %bpl,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl %r15b,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl %r13b,%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
movzbl 0xf(%rsp),%edi
xor    $0x31,%edi
call   1030 <putchar@plt>
and    $0x1,%ebx
xor    $0x31,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%rax
add    $0x1,%rax
cmp    %rax,0x30(%rsp)
jne    12c0 <dumpBytes+0x180>
mov    0x14(%rsp),%r15d
shl    $0x8,%r15d
mov    0x20(%rsp),%rbp
mov    0x28(%rsp),%r12
mov    0x2c02(%rip),%r13
jmp    1170 <dumpBytes+0x30>
mov    %al,0x13(%rsp)
movzbl %al,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x2bd7(%rip),%rax
mov    (%rax),%esi
lea    0xc23(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x4,%ebx
jmp    12ad <dumpBytes+0x16d>
mov    $0xa,%edi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%04X: \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 [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
br label %7
7: ; preds = %93, %1
%8 = phi i32 [ 0, %1 ], [ %11, %93 ]
%9 = trunc i32 %8 to i8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i32 %8, 4
%12 = tail call i32 @fgetc(i32* %0)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %38, label %15
15: ; preds = %7
%16 = trunc i32 %12 to i8
store i8 %16, i8* %3
%17 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %16)
%18 = tail call i32 @fgetc(i32* %0)
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %18, %19
br i1 %20, label %38, label %21
21: ; preds = %15
%22 = trunc i32 %18 to i8
store i8 %22, i8* %4
%23 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %22)
%24 = tail call i32 @fgetc(i32* %0)
%25 = load i32, i32* @EOF
%26 = icmp eq i32 %24, %25
br i1 %26, label %38, label %27
27: ; preds = %21
%28 = trunc i32 %24 to i8
store i8 %28, i8* %5
%29 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %28)
%30 = tail call i32 @fgetc(i32* %0)
%31 = load i32, i32* @EOF
%32 = icmp eq i32 %30, %31
br i1 %32, label %38, label %33
33: ; preds = %27
%34 = trunc i32 %30 to i8
store i8 %34, i8* %6
%35 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %34)
%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)
br label %51
38: ; preds = %27, %21, %15, %7
%39 = phi i32 [ %12, %7 ], [ %18, %15 ], [ %24, %21 ], [ %30, %27 ]
%40 = phi i1 [ true, %7 ], [ false, %15 ], [ false, %21 ], [ false, %27 ]
%41 = phi i32 [ 0, %7 ], [ 1, %15 ], [ 2, %21 ], [ 3, %27 ]
br label %42
42: ; preds = %38, %42
%43 = phi i32 [ %46, %42 ], [ %41, %38 ]
%44 = load i32, i32* @stdout
%45 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = add nuw nsw i32 %43, 1
%47 = icmp eq i32 %46, 4
br i1 %47, label %48, label %42
48: ; preds = %42
%49 = load i32, i32* @stdout
%50 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %49)
br i1 %40, label %93, label %51
51: ; preds = %33, %48
%52 = phi i32 [ 4, %33 ], [ %41, %48 ]
%53 = zext i32 %52 to i64
br label %54
54: ; preds = %51, %54
%55 = phi i64 [ 0, %51 ], [ %88, %54 ]
%56 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = insertelement <8 x i32> poison, i32 %58, i64 0
%60 = shufflevector <8 x i32> %59, <8 x i32> poison, <8 x i32> zeroinitializer
%61 = and <8 x i32> %60, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%62 = icmp eq <8 x i32> %61, zeroinitializer
%63 = extractelement <8 x i1> %62, i64 7
%64 = select i1 %63, i8 48, i8 49
%65 = tail call i32 @putchar(i8 signext %64)
%66 = extractelement <8 x i1> %62, i64 6
%67 = select i1 %66, i8 48, i8 49
%68 = tail call i32 @putchar(i8 signext %67)
%69 = extractelement <8 x i1> %62, i64 5
%70 = select i1 %69, i8 48, i8 49
%71 = tail call i32 @putchar(i8 signext %70)
%72 = extractelement <8 x i1> %62, i64 4
%73 = select i1 %72, i8 48, i8 49
%74 = tail call i32 @putchar(i8 signext %73)
%75 = extractelement <8 x i1> %62, i64 3
%76 = select i1 %75, i8 48, i8 49
%77 = tail call i32 @putchar(i8 signext %76)
%78 = extractelement <8 x i1> %62, i64 2
%79 = select i1 %78, i8 48, i8 49
%80 = tail call i32 @putchar(i8 signext %79)
%81 = extractelement <8 x i1> %62, i64 1
%82 = select i1 %81, i8 48, i8 49
%83 = tail call i32 @putchar(i8 signext %82)
%84 = extractelement <8 x i1> %62, i64 0
%85 = select i1 %84, i8 48, i8 49
%86 = tail call i32 @putchar(i8 signext %85)
%87 = tail call i32 @putchar(i8 signext 32)
%88 = add nuw nsw i64 %55, 1
%89 = icmp eq i64 %88, %53
br i1 %89, label %90, label %54
90: ; preds = %54
%91 = zext i8 %57 to i32
%92 = shl nuw nsw i32 %91, 8
br label %93
93: ; preds = %90, %48
%94 = phi i32 [ %39, %48 ], [ %92, %90 ]
%95 = tail call i32 @putchar(i8 signext 10)
%96 = load i32, i32* @EOF
%97 = icmp eq i32 %94, %96
br i1 %97, label %98, label %7
98: ; preds = %93
%99 = tail call i32 @putchar(i8 signext 10)
ret void
}