#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 dispBytes(unsigned char *pB, int count) {
  while (count) {
    printf("%x ", *pB);
    pB++;
    count--;
    if (!(count % 16))
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<dispBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     117a <dispBytes+0x6a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1175 <dispBytes+0x65>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <dispBytes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispBytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1168 <dispBytes+0x48>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0xffffffff,%ebx
lea    0xec8(%rip),%r15
jmp    1149 <dispBytes+0x29>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
add    $0xffffffff,%ebx
jae    1168 <dispBytes+0x48>
movzbl (%r14),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0xf,%bl
jne    1140 <dispBytes+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <dispBytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dispBytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %22, %2
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = srem i32 %17, 16
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %8
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %8
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x \00"
define void @dispBytes(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2, %16
%5 = phi i32 [ %11, %16 ], [ %1, %2 ]
%6 = phi i8* [ %10, %16 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nsw i32 %5, -1
%12 = and i32 %11, 15
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = tail call i32 @putchar(i32 10)
br label %16
16: ; preds = %14, %4
%17 = icmp eq i32 %11, 0
br i1 %17, label %18, label %4
18: ; preds = %16, %2
ret void
}