#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*/ xprintf(char *, ...);
void ShowMakerNoteGeneric(unsigned char *ValuePtr, int ByteCount) {
  int a;
  for (a = 0; a < ByteCount; a++) {
    if (a > 10) {
      xprintf("...");
      break;
    }
    xprintf(" %02x", ValuePtr[a]);
  }
  xprintf(" (%d bytes)", ByteCount);
  xprintf("\n");
}


x86 assembly (clang, -O0):
<ShowMakerNoteGeneric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <ShowMakerNoteGeneric+0x67>
cmpl   $0xa,-0x10(%rbp)
jle    114f <ShowMakerNoteGeneric+0x3f>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <xprintf@plt>
jmp    1177 <ShowMakerNoteGeneric+0x67>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <xprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ShowMakerNoteGeneric+0x16>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <xprintf@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <xprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowMakerNoteGeneric>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
test   %esi,%esi
jle    124d <ShowMakerNoteGeneric+0x13d>
mov    %rdi,%r14
movzbl (%rdi),%esi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x1,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x1(%r14),%esi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x2,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x2(%r14),%esi
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x3,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x3(%r14),%esi
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x4,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x4(%r14),%esi
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x5,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x5(%r14),%esi
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x6,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x6(%r14),%esi
lea    0xe31(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x7,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x7(%r14),%esi
lea    0xe19(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x8,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x8(%r14),%esi
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0x9,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0x9(%r14),%esi
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0xa,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
movzbl 0xa(%r14),%esi
lea    0xdd1(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
cmp    $0xb,%ebx
je     124d <ShowMakerNoteGeneric+0x13d>
lea    0xdba(%rip),%rdi
xor    %eax,%eax
call   1030 <xprintf@plt>
lea    0xdb6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <xprintf@plt>
lea    0xdb2(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xprintf@plt>

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

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