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

/* Variables and functions */
int /*<<< orphan*/ printFormat(int /*<<< orphan*/, char *, int /*<<< orphan*/,
                               int, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
void printDump(off_t baseOffset, char *data, ssize_t amount, int formats) {
  if ((formats & (1 << 0)) != 0) {
    formats &= ~(1 << 0);
    puts("Binary");
    printFormat(baseOffset, data, amount, 8, (1 << 0));
    if (formats) {
      putchar('\n');
    }
  }
  if ((formats & (1 << 1)) != 0) {
    formats &= ~(1 << 1);
    puts("Octal");
    printFormat(baseOffset, data, amount, 18, (1 << 1));
    if (formats) {
      putchar('\n');
    }
  }
  if ((formats & (1 << 2)) != 0) {
    formats &= ~(1 << 2);
    puts("Decimal");
    printFormat(baseOffset, data, amount, 18, (1 << 2));
    if (formats) {
      putchar('\n');
    }
  }
  if ((formats & (1 << 3)) != 0) {
    puts("Hexadecimal");
    printFormat(baseOffset, data, amount, 24, (1 << 3));
    if (formats & ~(1 << 3)) {
      putchar('\n');
    }
  }
  if ((formats & (1 << 4)) != 0) {
    puts("Alphanumeric");
    printFormat(baseOffset, data, amount, 36, (1 << 4));
  }
}


x86 assembly (clang, -O0):
<printDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     119c <printDump+0x6c>
mov    -0x18(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0x18(%rbp)
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x8,%ecx
mov    $0x1,%r8d
call   1050 <printFormat@plt>
cmpl   $0x0,-0x18(%rbp)
je     1197 <printDump+0x67>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    119c <printDump+0x6c>
mov    -0x18(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     11f3 <printDump+0xc3>
mov    -0x18(%rbp),%eax
and    $0xfffffffd,%eax
mov    %eax,-0x18(%rbp)
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x12,%ecx
mov    $0x2,%r8d
call   1050 <printFormat@plt>
cmpl   $0x0,-0x18(%rbp)
je     11ee <printDump+0xbe>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11f3 <printDump+0xc3>
mov    -0x18(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     124a <printDump+0x11a>
mov    -0x18(%rbp),%eax
and    $0xfffffffb,%eax
mov    %eax,-0x18(%rbp)
lea    0xdfb(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x12,%ecx
mov    $0x4,%r8d
call   1050 <printFormat@plt>
cmpl   $0x0,-0x18(%rbp)
je     1245 <printDump+0x115>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    124a <printDump+0x11a>
mov    -0x18(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     129d <printDump+0x16d>
lea    0xdb5(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x18,%ecx
mov    $0x8,%r8d
call   1050 <printFormat@plt>
mov    -0x18(%rbp),%eax
and    $0xfffffff7,%eax
cmp    $0x0,%eax
je     1298 <printDump+0x168>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    129d <printDump+0x16d>
mov    -0x18(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     12d2 <printDump+0x1a2>
lea    0xd6e(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x24,%ecx
mov    $0x10,%r8d
call   1050 <printFormat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDump>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %edi,%ebp
test   $0x1,%bl
je     117d <printDump+0x4d>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0x8,%ecx
mov    $0x1,%r8d
call   1050 <printFormat@plt>
and    $0xfffffffe,%ebx
je     1231 <printDump+0x101>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x2,%bl
je     11b9 <printDump+0x89>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0x12,%ecx
mov    $0x2,%r8d
call   1050 <printFormat@plt>
and    $0xfffffffd,%ebx
je     1231 <printDump+0x101>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x4,%bl
je     11f1 <printDump+0xc1>
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0x12,%ecx
mov    $0x4,%r8d
call   1050 <printFormat@plt>
and    $0xfffffffb,%ebx
je     1231 <printDump+0x101>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x8,%bl
je     122c <printDump+0xfc>
lea    0xe18(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0x18,%ecx
mov    $0x8,%r8d
call   1050 <printFormat@plt>
test   $0xfffffff7,%ebx
je     1231 <printDump+0x101>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x10,%bl
jne    123c <printDump+0x10c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdde(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    $0x24,%ecx
mov    $0x10,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printFormat@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Binary\00"
@.str.1 = [6 x i8] c"Octal\00"
@.str.2 = [8 x i8] c"Decimal\00"
@.str.3 = [12 x i8] c"Hexadecimal\00"
@.str.4 = [13 x i8] c"Alphanumeric\00"
define void @printDump(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %4
%13 = load i32, i32* %8
%14 = and i32 %13, -2
store i32 %14, i32* %8
%15 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %5
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = call i32 @printFormat(i32 %16, i8* %17, i32 %18, i32 8, i32 1)
%20 = load i32, i32* %8
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %12
%23 = call i32 @putchar(i8 signext 10)
br label %24
24: ; preds = %22, %12
br label %25
25: ; preds = %24, %4
%26 = load i32, i32* %8
%27 = and i32 %26, 2
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %42
29: ; preds = %25
%30 = load i32, i32* %8
%31 = and i32 %30, -3
store i32 %31, i32* %8
%32 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%33 = load i32, i32* %5
%34 = load i8*, i8** %6
%35 = load i32, i32* %7
%36 = call i32 @printFormat(i32 %33, i8* %34, i32 %35, i32 18, i32 2)
%37 = load i32, i32* %8
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %29
%40 = call i32 @putchar(i8 signext 10)
br label %41
41: ; preds = %39, %29
br label %42
42: ; preds = %41, %25
%43 = load i32, i32* %8
%44 = and i32 %43, 4
%45 = icmp ne i32 %44, 0
br i1 %45, label %46, label %59
46: ; preds = %42
%47 = load i32, i32* %8
%48 = and i32 %47, -5
store i32 %48, i32* %8
%49 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%50 = load i32, i32* %5
%51 = load i8*, i8** %6
%52 = load i32, i32* %7
%53 = call i32 @printFormat(i32 %50, i8* %51, i32 %52, i32 18, i32 4)
%54 = load i32, i32* %8
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %46
%57 = call i32 @putchar(i8 signext 10)
br label %58
58: ; preds = %56, %46
br label %59
59: ; preds = %58, %42
%60 = load i32, i32* %8
%61 = and i32 %60, 8
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %75
63: ; preds = %59
%64 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%65 = load i32, i32* %5
%66 = load i8*, i8** %6
%67 = load i32, i32* %7
%68 = call i32 @printFormat(i32 %65, i8* %66, i32 %67, i32 24, i32 8)
%69 = load i32, i32* %8
%70 = and i32 %69, -9
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %63
%73 = call i32 @putchar(i8 signext 10)
br label %74
74: ; preds = %72, %63
br label %75
75: ; preds = %74, %59
%76 = load i32, i32* %8
%77 = and i32 %76, 16
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %85
79: ; preds = %75
%80 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%81 = load i32, i32* %5
%82 = load i8*, i8** %6
%83 = load i32, i32* %7
%84 = call i32 @printFormat(i32 %81, i8* %82, i32 %83, i32 36, i32 16)
br label %85
85: ; preds = %79, %75
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Binary\00"
@.str.1 = [6 x i8] c"Octal\00"
@.str.2 = [8 x i8] c"Decimal\00"
@.str.3 = [12 x i8] c"Hexadecimal\00"
@.str.4 = [13 x i8] c"Alphanumeric\00"
define void @printDump(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = and i32 %3, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = and i32 %3, -2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @printFormat(i32 %0, i8* %1, i32 %2, i32 8, i32 1)
%11 = icmp eq i32 %8, 0
br i1 %11, label %53, label %12
12: ; preds = %7
%13 = tail call i32 @putchar(i8 signext 10)
br label %14
14: ; preds = %12, %4
%15 = phi i32 [ %8, %12 ], [ %3, %4 ]
%16 = and i32 %15, 2
%17 = icmp eq i32 %16, 0
br i1 %17, label %25, label %18
18: ; preds = %14
%19 = and i32 %15, -3
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = tail call i32 @printFormat(i32 %0, i8* %1, i32 %2, i32 18, i32 2)
%22 = icmp eq i32 %19, 0
br i1 %22, label %53, label %23
23: ; preds = %18
%24 = tail call i32 @putchar(i8 signext 10)
br label %25
25: ; preds = %23, %14
%26 = phi i32 [ %19, %23 ], [ %15, %14 ]
%27 = and i32 %26, 4
%28 = icmp eq i32 %27, 0
br i1 %28, label %36, label %29
29: ; preds = %25
%30 = and i32 %26, -5
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @printFormat(i32 %0, i8* %1, i32 %2, i32 18, i32 4)
%33 = icmp eq i32 %30, 0
br i1 %33, label %53, label %34
34: ; preds = %29
%35 = tail call i32 @putchar(i8 signext 10)
br label %36
36: ; preds = %34, %25
%37 = phi i32 [ %30, %34 ], [ %26, %25 ]
%38 = and i32 %37, 8
%39 = icmp eq i32 %38, 0
br i1 %39, label %47, label %40
40: ; preds = %36
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%42 = tail call i32 @printFormat(i32 %0, i8* %1, i32 %2, i32 24, i32 8)
%43 = and i32 %37, -9
%44 = icmp eq i32 %43, 0
br i1 %44, label %53, label %45
45: ; preds = %40
%46 = tail call i32 @putchar(i8 signext 10)
br label %47
47: ; preds = %45, %36
%48 = and i32 %37, 16
%49 = icmp eq i32 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%52 = tail call i32 @printFormat(i32 %0, i8* %1, i32 %2, i32 36, i32 16)
br label %53
53: ; preds = %7, %18, %29, %40, %50, %47
ret void
}