#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 /*<<< orphan*/ newline();
int /*<<< orphan*/ print_byte(unsigned char);
int /*<<< orphan*/ print_word(unsigned int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
print_bytes(unsigned char *p, int len) {
  int ii, kk;
  int jj = 0;
  char lbuf[16];
  for (ii = 0; ii < len; ii++) {
    if ((ii & 0xf) == 0) {
      print_word((unsigned int)p + ii);
      puts(": ");
    }
    print_byte(p[ii]);
    lbuf[jj++] = p[ii];
    putchar(' ');
    if ((ii & 0xf) == 0xf) {
      putchar(' ');
      for (kk = 0; kk < 16; kk++) {
        if ((lbuf[kk] >= 0x20) && (lbuf[kk] < 0x80))
          putchar(lbuf[kk]);
        else
          putchar('.');
      }
      jj = 0;
      newline();
    }
  }
  newline();
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    127a <print_bytes+0x12a>
mov    -0x18(%rbp),%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    11a2 <print_bytes+0x52>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
add    -0x18(%rbp),%edi
call   1070 <print_word@plt>
lea    0xe63(%rip),%rdi
call   1050 <puts@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1060 <print_byte@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %cl,-0x30(%rbp,%rax,1)
mov    $0x20,%edi
call   1040 <putchar@plt>
mov    -0x18(%rbp),%eax
and    $0xf,%eax
cmp    $0xf,%eax
jne    1267 <print_bytes+0x117>
mov    $0x20,%edi
call   1040 <putchar@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    1259 <print_bytes+0x109>
movslq -0x1c(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jl     123c <print_bytes+0xec>
movslq -0x1c(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
cmp    $0x80,%eax
jge    123c <print_bytes+0xec>
movslq -0x1c(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%edi
call   1040 <putchar@plt>
jmp    1246 <print_bytes+0xf6>
mov    $0x2e,%edi
call   1040 <putchar@plt>
jmp    124b <print_bytes+0xfb>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f9 <print_bytes+0xa9>
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <newline@plt>
jmp    126c <print_bytes+0x11c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116d <print_bytes+0x1d>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bytes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    1313 <print_bytes+0x1c3>
mov    %rdi,%r12
mov    %esi,%r15d
xor    %ebx,%ebx
mov    $0x2e,%r13d
xor    %ebp,%ebp
jmp    12c7 <print_bytes+0x177>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1040 <putchar@plt>
mov    (%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x1(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x2(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x3(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
mov    0x4(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x5(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x6(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x7(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0x9(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0xa(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0xb(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
mov    0xc(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0xd(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0xe(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
movzbl 0xf(%rsp),%eax
cmp    $0x20,%al
cmovl  %r13d,%eax
movsbl %al,%edi
call   1040 <putchar@plt>
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <newline@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     1313 <print_bytes+0x1c3>
mov    %ebx,%r14d
and    $0xf,%r14d
jne    12e5 <print_bytes+0x195>
lea    (%r12,%rbx,1),%edi
call   1070 <print_word@plt>
lea    0xd20(%rip),%rdi
call   1050 <puts@plt>
movzbl (%r12,%rbx,1),%edi
call   1060 <print_byte@plt>
movzbl (%r12,%rbx,1),%eax
movslq %ebp,%rcx
mov    %al,(%rsp,%rcx,1)
mov    $0x20,%edi
call   1040 <putchar@plt>
cmp    $0xf,%r14d
je     1180 <print_bytes+0x30>
add    $0x1,%ebp
jmp    12be <print_bytes+0x16e>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <newline@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c": \00"
define i32 @print_bytes(i8* %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %117
6: ; preds = %2
%7 = ptrtoint i8* %0 to i64
%8 = trunc i64 %7 to i32
%9 = zext i32 %1 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 1
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 2
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 3
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 4
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 5
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 6
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 7
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 8
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 9
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 10
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 11
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 12
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 13
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 14
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 15
br label %26
26: ; preds = %6, %113
%27 = phi i64 [ 0, %6 ], [ %115, %113 ]
%28 = phi i32 [ 0, %6 ], [ %114, %113 ]
%29 = trunc i64 %27 to i32
%30 = and i32 %29, 15
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = add i32 %29, %8
%34 = tail call i32 @print_word(i32 %33)
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %36
36: ; preds = %32, %26
%37 = getelementptr inbounds i8, i8* %0, i64 %27
%38 = load i8, i8* %37
%39 = tail call i32 @print_byte(i8 zeroext %38)
%40 = load i8, i8* %37
%41 = add nsw i32 %28, 1
%42 = sext i32 %28 to i64
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %42
store i8 %40, i8* %43
%44 = tail call i32 @putchar(i8 signext 32)
%45 = icmp eq i32 %30, 15
br i1 %45, label %46, label %113
46: ; preds = %36
%47 = tail call i32 @putchar(i8 signext 32)
%48 = load i8, i8* %10
%49 = icmp sgt i8 %48, 31
%50 = select i1 %49, i8 %48, i8 46
%51 = tail call i32 @putchar(i8 signext %50)
%52 = load i8, i8* %11
%53 = icmp sgt i8 %52, 31
%54 = select i1 %53, i8 %52, i8 46
%55 = tail call i32 @putchar(i8 signext %54)
%56 = load i8, i8* %12
%57 = icmp sgt i8 %56, 31
%58 = select i1 %57, i8 %56, i8 46
%59 = tail call i32 @putchar(i8 signext %58)
%60 = load i8, i8* %13
%61 = icmp sgt i8 %60, 31
%62 = select i1 %61, i8 %60, i8 46
%63 = tail call i32 @putchar(i8 signext %62)
%64 = load i8, i8* %14
%65 = icmp sgt i8 %64, 31
%66 = select i1 %65, i8 %64, i8 46
%67 = tail call i32 @putchar(i8 signext %66)
%68 = load i8, i8* %15
%69 = icmp sgt i8 %68, 31
%70 = select i1 %69, i8 %68, i8 46
%71 = tail call i32 @putchar(i8 signext %70)
%72 = load i8, i8* %16
%73 = icmp sgt i8 %72, 31
%74 = select i1 %73, i8 %72, i8 46
%75 = tail call i32 @putchar(i8 signext %74)
%76 = load i8, i8* %17
%77 = icmp sgt i8 %76, 31
%78 = select i1 %77, i8 %76, i8 46
%79 = tail call i32 @putchar(i8 signext %78)
%80 = load i8, i8* %18
%81 = icmp sgt i8 %80, 31
%82 = select i1 %81, i8 %80, i8 46
%83 = tail call i32 @putchar(i8 signext %82)
%84 = load i8, i8* %19
%85 = icmp sgt i8 %84, 31
%86 = select i1 %85, i8 %84, i8 46
%87 = tail call i32 @putchar(i8 signext %86)
%88 = load i8, i8* %20
%89 = icmp sgt i8 %88, 31
%90 = select i1 %89, i8 %88, i8 46
%91 = tail call i32 @putchar(i8 signext %90)
%92 = load i8, i8* %21
%93 = icmp sgt i8 %92, 31
%94 = select i1 %93, i8 %92, i8 46
%95 = tail call i32 @putchar(i8 signext %94)
%96 = load i8, i8* %22
%97 = icmp sgt i8 %96, 31
%98 = select i1 %97, i8 %96, i8 46
%99 = tail call i32 @putchar(i8 signext %98)
%100 = load i8, i8* %23
%101 = icmp sgt i8 %100, 31
%102 = select i1 %101, i8 %100, i8 46
%103 = tail call i32 @putchar(i8 signext %102)
%104 = load i8, i8* %24
%105 = icmp sgt i8 %104, 31
%106 = select i1 %105, i8 %104, i8 46
%107 = tail call i32 @putchar(i8 signext %106)
%108 = load i8, i8* %25
%109 = icmp sgt i8 %108, 31
%110 = select i1 %109, i8 %108, i8 46
%111 = tail call i32 @putchar(i8 signext %110)
%112 = tail call i32 (...) @newline()
br label %113
113: ; preds = %36, %46
%114 = phi i32 [ 0, %46 ], [ %41, %36 ]
%115 = add nuw nsw i64 %27, 1
%116 = icmp eq i64 %115, %9
br i1 %116, label %117, label %26
117: ; preds = %113, %2
%118 = tail call i32 (...) @newline()
ret i32 undef
}