#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*/ printf(char *, ...);
void printBytes(unsigned char *aData, unsigned char *aStart, int nByte) {
  int j;
  printf(" %03x: ", (int)(aStart - aData));
  for (j = 0; j < 9; j++) {
    if (j >= nByte) {
      printf("   ");
    } else {
      printf("%02x ", aStart[j]);
    }
  }
}


x86 assembly (clang, -O0):
<printBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    119b <printBytes+0x8b>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     116e <printBytes+0x5e>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <printBytes+0x78>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118d <printBytes+0x7d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1145 <printBytes+0x35>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBytes>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
sub    %edi,%esi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebp,%ebp
jle    121f <printBytes+0x10f>
movzbl (%rbx),%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x1,%ebp
je     122d <printBytes+0x11d>
movzbl 0x1(%rbx),%esi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebp
jbe    123b <printBytes+0x12b>
movzbl 0x2(%rbx),%esi
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x3,%ebp
je     1249 <printBytes+0x139>
movzbl 0x3(%rbx),%esi
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x4,%ebp
jbe    1257 <printBytes+0x147>
movzbl 0x4(%rbx),%esi
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x5,%ebp
je     1265 <printBytes+0x155>
movzbl 0x5(%rbx),%esi
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x6,%ebp
jbe    1273 <printBytes+0x163>
movzbl 0x6(%rbx),%esi
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x7,%ebp
je     1281 <printBytes+0x171>
movzbl 0x7(%rbx),%esi
lea    0xe15(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x8,%ebp
jbe    128f <printBytes+0x17f>
movzbl 0x8(%rbx),%esi
lea    0xdfa(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdd4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdc6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd8e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd80(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd72(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %03x: \00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [6 x i8] c"%02x \00"
define void @printBytes(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %8 to i64
%11 = ptrtoint i8* %9 to i64
%12 = sub i64 %10, %11
%13 = trunc i64 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 0, i32* %7
br label %15
15: ; preds = %33, %3
%16 = load i32, i32* %7
%17 = icmp slt i32 %16, 9
br i1 %17, label %18, label %36
18: ; preds = %15
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = icmp sge i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %32
24: ; preds = %18
%25 = load i8*, i8** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %24, %22
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %15
36: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %03x: \00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [6 x i8] c"%02x \00"
define void @printBytes(i8* %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = icmp sgt i32 %2, 0
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %17
12: ; preds = %3
%13 = load i8, i8* %1
%14 = zext i8 %13 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = icmp eq i32 %2, 1
br i1 %16, label %17, label %19
17: ; preds = %12, %10
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %25
19: ; preds = %12
%20 = getelementptr inbounds i8, i8* %1, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = icmp ugt i32 %2, 2
br i1 %24, label %27, label %25
25: ; preds = %19, %17
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %33
27: ; preds = %19
%28 = getelementptr inbounds i8, i8* %1, i64 2
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = icmp eq i32 %2, 3
br i1 %32, label %33, label %35
33: ; preds = %27, %25
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %41
35: ; preds = %27
%36 = getelementptr inbounds i8, i8* %1, i64 3
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = icmp ugt i32 %2, 4
br i1 %40, label %43, label %41
41: ; preds = %35, %33
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %49
43: ; preds = %35
%44 = getelementptr inbounds i8, i8* %1, i64 4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = icmp eq i32 %2, 5
br i1 %48, label %49, label %51
49: ; preds = %43, %41
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %57
51: ; preds = %43
%52 = getelementptr inbounds i8, i8* %1, i64 5
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %54)
%56 = icmp ugt i32 %2, 6
br i1 %56, label %59, label %57
57: ; preds = %51, %49
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %65
59: ; preds = %51
%60 = getelementptr inbounds i8, i8* %1, i64 6
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = icmp eq i32 %2, 7
br i1 %64, label %65, label %67
65: ; preds = %59, %57
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %73
67: ; preds = %59
%68 = getelementptr inbounds i8, i8* %1, i64 7
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = icmp ugt i32 %2, 8
br i1 %72, label %75, label %73
73: ; preds = %65, %67
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %80
75: ; preds = %67
%76 = getelementptr inbounds i8, i8* %1, i64 8
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %78)
br label %80
80: ; preds = %75, %73
ret void
}