#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 dump(char const *xm, char const *label) {
  char const *cp = &xm[16];
  do
    printf("%02X ", 255 & *--cp);
  while (cp != xm);
  printf(" %s\n", label);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
movsbl -0x1(%rax),%esi
and    $0xff,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    112c <dump+0x1c>
mov    -0x10(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl 0xf(%rdi),%esi
lea    0xeda(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0xe(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0xd(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0xb(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x7(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x6(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x3(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x2(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x1(%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl (%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

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

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