#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void _dumpHexCBytes(FILE *fp, const unsigned char *pBytes, long iLen) {
  long i;
  for (i = 0; i < iLen; i++) {
    if (i && ((i % 16) == 0)) {
      fprintf(fp, "\n");
    }
    fprintf(fp, "0x%02x,", pBytes[i]);
  }
  fprintf(fp, "\n");
}


x86 assembly (clang, -O0):
<_dumpHexCBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    119e <_dumpHexCBytes+0x8e>
cmpq   $0x0,-0x20(%rbp)
je     116f <_dumpHexCBytes+0x5f>
mov    -0x20(%rbp),%rax
mov    $0x10,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    116f <_dumpHexCBytes+0x5f>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <_dumpHexCBytes+0x1c>
mov    -0x8(%rbp),%rdi
lea    0xe57(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dumpHexCBytes>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r13
test   %rdx,%rdx
jle    1189 <_dumpHexCBytes+0x69>
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xec2(%rip),%r12
xor    %ebx,%ebx
jmp    116b <_dumpHexCBytes+0x4b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r15,%rbx,1),%edx
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
je     1189 <_dumpHexCBytes+0x69>
test   %rbx,%rbx
je     1150 <_dumpHexCBytes+0x30>
mov    %ebx,%eax
and    $0xf,%eax
test   %rax,%rax
jne    1150 <_dumpHexCBytes+0x30>
mov    $0xa,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
jmp    1150 <_dumpHexCBytes+0x30>
mov    $0xa,%edi
mov    %r13,%rsi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

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

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