#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 *, char const *, ...);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char, unsigned char, unsigned char,
                           unsigned char, unsigned char);
void logData(unsigned char *p, size_t pLen, const char *func, const char *msg) {
  int x;
  printf("%s(): ========== %s: %p.\n", func, msg, p);
  if ((p != 0) && (pLen > 0)) {
    for (x = 0; x < pLen; x += 16) {
      char buf[128];
      sprintf(buf,
              "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X "
              "%02X %02X %02X %02X",
              p[x + 0], p[x + 1], p[x + 2], p[x + 3], p[x + 4], p[x + 5],
              p[x + 6], p[x + 7], p[x + 8], p[x + 9], p[x + 10], p[x + 11],
              p[x + 12], p[x + 13], p[x + 14], p[x + 15]);
      printf("%s(): %04X: %s\n", func, x, buf);
    }
  }
  printf("%s(): ========== End of %s.\n", func, msg);
}


x86 assembly (clang, -O0):
<logData>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x30(%rbp)
je     1397 <logData+0x277>
cmpq   $0x0,-0x38(%rbp)
jbe    1397 <logData+0x277>
movl   $0x0,-0x4c(%rbp)
movslq -0x4c(%rbp),%rax
cmp    -0x38(%rbp),%rax
jae    1392 <logData+0x272>
lea    -0xd0(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%esi
add    $0x2,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,1),%r8b
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%esi
add    $0x3,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,1),%r9b
mov    -0x30(%rbp),%rax
mov    -0x4c(%rbp),%esi
add    $0x4,%esi
movslq %esi,%rsi
mov    (%rax,%rsi,1),%al
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0x5,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%sil
mov    %sil,-0xdc(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0x6,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%sil
mov    %sil,-0xdb(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0x7,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%sil
mov    %sil,-0xda(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0x8,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%sil
mov    %sil,-0xd9(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0x9,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%r13b
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0xa,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%r12b
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0xb,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%r15b
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0xc,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%r14b
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0xd,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%bl
mov    -0x30(%rbp),%rsi
mov    -0x4c(%rbp),%r10d
add    $0xe,%r10d
movslq %r10d,%r10
mov    (%rsi,%r10,1),%r11b
mov    -0x30(%rbp),%rsi
mov    %rsi,-0xd8(%rbp)
mov    -0x4c(%rbp),%esi
add    $0xf,%esi
movslq %esi,%r10
lea    0xd43(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %al,%eax
mov    %eax,(%rsp)
mov    -0xdc(%rbp),%al
movzbl %al,%eax
mov    %eax,0x8(%rsp)
mov    -0xdb(%rbp),%al
movzbl %al,%eax
mov    %eax,0x10(%rsp)
mov    -0xda(%rbp),%al
movzbl %al,%eax
mov    %eax,0x18(%rsp)
mov    -0xd9(%rbp),%al
movzbl %al,%eax
mov    %eax,0x20(%rsp)
mov    -0xd8(%rbp),%rax
movzbl %r13b,%r13d
mov    %r13d,0x28(%rsp)
movzbl %r12b,%r12d
mov    %r12d,0x30(%rsp)
movzbl %r15b,%r15d
mov    %r15d,0x38(%rsp)
movzbl %r14b,%r14d
mov    %r14d,0x40(%rsp)
movzbl %bl,%ebx
mov    %ebx,0x48(%rsp)
movzbl %r11b,%r11d
mov    %r11d,0x50(%rsp)
movzbl (%rax,%r10,1),%eax
mov    %eax,0x58(%rsp)
call   1040 <sprintf@plt>
mov    -0x40(%rbp),%rsi
mov    -0x4c(%rbp),%edx
lea    -0xd0(%rbp),%rcx
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x4c(%rbp)
jmp    117b <logData+0x5b>
jmp    1397 <logData+0x277>
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<logData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,%r14
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    %rdx,%rsi
mov    %rcx,(%rsp)
mov    %rcx,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
test   %rbx,%rbx
je     125b <logData+0x13b>
test   %rbp,%rbp
je     125b <logData+0x13b>
xor    %r13d,%r13d
mov    %r14,0x8(%rsp)
nop
movzbl (%rbx,%r13,1),%edx
movzbl 0x1(%rbx,%r13,1),%ecx
movzbl 0x2(%rbx,%r13,1),%r8d
movzbl 0x3(%rbx,%r13,1),%r9d
movzbl 0x4(%rbx,%r13,1),%eax
mov    %rax,0x38(%rsp)
movzbl 0x5(%rbx,%r13,1),%eax
mov    %rax,0x30(%rsp)
movzbl 0x6(%rbx,%r13,1),%eax
mov    %rax,0x28(%rsp)
movzbl 0x7(%rbx,%r13,1),%eax
mov    %rax,0x20(%rsp)
movzbl 0x8(%rbx,%r13,1),%eax
mov    %rax,0x18(%rsp)
movzbl 0x9(%rbx,%r13,1),%eax
mov    %rax,0x10(%rsp)
mov    %rbp,%r14
movzbl 0xa(%rbx,%r13,1),%r12d
movzbl 0xb(%rbx,%r13,1),%r10d
movzbl 0xc(%rbx,%r13,1),%r11d
movzbl 0xd(%rbx,%r13,1),%eax
movzbl 0xe(%rbx,%r13,1),%ebp
movzbl 0xf(%rbx,%r13,1),%r15d
lea    0x40(%rsp),%rdi
lea    0xe1e(%rip),%rsi
push   %r15
push   %rbp
push   %rax
push   %r11
push   %r10
push   %r12
mov    %r14,%rbp
mov    0x38(%rsp),%r14
push   0x40(%rsp)
push   0x50(%rsp)
push   0x60(%rsp)
push   0x70(%rsp)
push   0x80(%rsp)
push   0x90(%rsp)
call   1040 <sprintf@plt>
add    $0x60,%rsp
lea    0xe2e(%rip),%rdi
mov    %r14,%rsi
mov    %r13d,%edx
lea    0x40(%rsp),%rcx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%r13
cmp    %rbp,%r13
jb     1170 <logData+0x50>
lea    0xe18(%rip),%rdi
mov    %r14,%rsi
mov    (%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"%s(): ========== %s: %p.\0A\00"
@.str.1 = [80 x i8] c"%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\00"
@.str.2 = [16 x i8] c"%s(): %04X: %s\0A\00"
@.str.3 = [29 x i8] c"%s(): ========== End of %s.\0A\00"
define void @logData(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca [128 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13)
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %133
17: ; preds = %4
%18 = load i64, i64* %6
%19 = icmp ugt i64 %18, 0
br i1 %19, label %20, label %133
20: ; preds = %17
store i32 0, i32* %9
br label %21
21: ; preds = %129, %20
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = load i64, i64* %6
%25 = icmp ult i64 %23, %24
br i1 %25, label %26, label %132
26: ; preds = %21
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%28 = load i8*, i8** %5
%29 = load i32, i32* %9
%30 = add nsw i32 %29, 0
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
%33 = load i8, i8* %32
%34 = load i8*, i8** %5
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %34, i64 %37
%39 = load i8, i8* %38
%40 = load i8*, i8** %5
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %40, i64 %43
%45 = load i8, i8* %44
%46 = load i8*, i8** %5
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %46, i64 %49
%51 = load i8, i8* %50
%52 = load i8*, i8** %5
%53 = load i32, i32* %9
%54 = add nsw i32 %53, 4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %52, i64 %55
%57 = load i8, i8* %56
%58 = load i8*, i8** %5
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %58, i64 %61
%63 = load i8, i8* %62
%64 = load i8*, i8** %5
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 6
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %64, i64 %67
%69 = load i8, i8* %68
%70 = load i8*, i8** %5
%71 = load i32, i32* %9
%72 = add nsw i32 %71, 7
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %70, i64 %73
%75 = load i8, i8* %74
%76 = load i8*, i8** %5
%77 = load i32, i32* %9
%78 = add nsw i32 %77, 8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %76, i64 %79
%81 = load i8, i8* %80
%82 = load i8*, i8** %5
%83 = load i32, i32* %9
%84 = add nsw i32 %83, 9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8, i8* %82, i64 %85
%87 = load i8, i8* %86
%88 = load i8*, i8** %5
%89 = load i32, i32* %9
%90 = add nsw i32 %89, 10
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %88, i64 %91
%93 = load i8, i8* %92
%94 = load i8*, i8** %5
%95 = load i32, i32* %9
%96 = add nsw i32 %95, 11
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %94, i64 %97
%99 = load i8, i8* %98
%100 = load i8*, i8** %5
%101 = load i32, i32* %9
%102 = add nsw i32 %101, 12
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i8, i8* %100, i64 %103
%105 = load i8, i8* %104
%106 = load i8*, i8** %5
%107 = load i32, i32* %9
%108 = add nsw i32 %107, 13
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %106, i64 %109
%111 = load i8, i8* %110
%112 = load i8*, i8** %5
%113 = load i32, i32* %9
%114 = add nsw i32 %113, 14
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %112, i64 %115
%117 = load i8, i8* %116
%118 = load i8*, i8** %5
%119 = load i32, i32* %9
%120 = add nsw i32 %119, 15
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %118, i64 %121
%123 = load i8, i8* %122
%124 = call i32 @sprintf(i8* %27, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %33, i8 zeroext %39, i8 zeroext %45, i8 zeroext %51, i8 zeroext %57, i8 zeroext %63, i8 zeroext %69, i8 zeroext %75, i8 zeroext %81, i8 zeroext %87, i8 zeroext %93, i8 zeroext %99, i8 zeroext %105, i8 zeroext %111, i8 zeroext %117, i8 zeroext %123)
%125 = load i8*, i8** %7
%126 = load i32, i32* %9
%127 = getelementptr inbounds [128 x i8], [128 x i8]* %10, i64 0, i64 0
%128 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %125, i32 %126, i8* %127)
br label %129
129: ; preds = %26
%130 = load i32, i32* %9
%131 = add nsw i32 %130, 16
store i32 %131, i32* %9
br label %21
132: ; preds = %21
br label %133
133: ; preds = %132, %17, %4
%134 = load i8*, i8** %7
%135 = load i8*, i8** %8
%136 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %134, i8* %135)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s(): ========== %s: %p.\0A\00"
@.str.1 = [80 x i8] c"%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\00"
@.str.2 = [16 x i8] c"%s(): %04X: %s\0A\00"
@.str.3 = [29 x i8] c"%s(): ========== End of %s.\0A\00"
define void @logData(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca [128 x i8]
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %0)
%7 = icmp ne i8* %0, null
%8 = icmp ne i64 %1, 0
%9 = and i1 %7, %8
br i1 %9, label %10, label %66
10: ; preds = %4
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 0, %10 ], [ %64, %12 ]
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = or i64 %13, 1
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = or i64 %13, 2
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = or i64 %13, 3
%23 = getelementptr inbounds i8, i8* %0, i64 %22
%24 = load i8, i8* %23
%25 = or i64 %13, 4
%26 = getelementptr inbounds i8, i8* %0, i64 %25
%27 = load i8, i8* %26
%28 = or i64 %13, 5
%29 = getelementptr inbounds i8, i8* %0, i64 %28
%30 = load i8, i8* %29
%31 = or i64 %13, 6
%32 = getelementptr inbounds i8, i8* %0, i64 %31
%33 = load i8, i8* %32
%34 = or i64 %13, 7
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = load i8, i8* %35
%37 = or i64 %13, 8
%38 = getelementptr inbounds i8, i8* %0, i64 %37
%39 = load i8, i8* %38
%40 = or i64 %13, 9
%41 = getelementptr inbounds i8, i8* %0, i64 %40
%42 = load i8, i8* %41
%43 = or i64 %13, 10
%44 = getelementptr inbounds i8, i8* %0, i64 %43
%45 = load i8, i8* %44
%46 = or i64 %13, 11
%47 = getelementptr inbounds i8, i8* %0, i64 %46
%48 = load i8, i8* %47
%49 = or i64 %13, 12
%50 = getelementptr inbounds i8, i8* %0, i64 %49
%51 = load i8, i8* %50
%52 = or i64 %13, 13
%53 = getelementptr inbounds i8, i8* %0, i64 %52
%54 = load i8, i8* %53
%55 = or i64 %13, 14
%56 = getelementptr inbounds i8, i8* %0, i64 %55
%57 = load i8, i8* %56
%58 = or i64 %13, 15
%59 = getelementptr inbounds i8, i8* %0, i64 %58
%60 = load i8, i8* %59
%61 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %15, i8 zeroext %18, i8 zeroext %21, i8 zeroext %24, i8 zeroext %27, i8 zeroext %30, i8 zeroext %33, i8 zeroext %36, i8 zeroext %39, i8 zeroext %42, i8 zeroext %45, i8 zeroext %48, i8 zeroext %51, i8 zeroext %54, i8 zeroext %57, i8 zeroext %60)
%62 = trunc i64 %13 to i32
%63 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 %62, i8* %11)
%64 = add nuw i64 %13, 16
%65 = icmp ult i64 %64, %1
br i1 %65, label %12, label %66
66: ; preds = %12, %4
%67 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %2, i8* %3)
ret void
}