dumparray(name, runs) char *name;
unsigned char runs[256];
{
  int i;
  char *sep;
  printf("static unsigned char %s[256] = {\n", name);
  sep = "    ";
  for (i = 0; i < 256; i++) {
    printf("%s%d", sep, runs[i]);
    if (((i + 1) % 16) == 0) {
      printf(",	/* 0x%02x - 0x%02x */\n", i - 15, i);
      sep = "    ";
    } else
      sep = ", ";
  }
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<dumparray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x100,-0x1c(%rbp)
jge    11cb <dumparray+0xbb>
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11ad <dumparray+0x9d>
mov    -0x1c(%rbp),%esi
sub    $0xf,%esi
mov    -0x1c(%rbp),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11b8 <dumparray+0xa8>
lea    0xe91(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    11bd <dumparray+0xad>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1144 <dumparray+0x34>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumparray>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%rsi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%r13
lea    0xeda(%rip),%r14
lea    0xef1(%rip),%rbp
xor    %ebx,%ebx
mov    %r13,%rsi
jmp    116c <dumparray+0x4c>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rbx
cmp    $0x100,%r15
je     11a0 <dumparray+0x80>
movzbl (%r12,%rbx,1),%edx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%r15
mov    %rbp,%rsi
test   $0xf,%r15b
jne    1160 <dumparray+0x40>
lea    -0xf(%rbx),%esi
lea    0xe9a(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rsi
jmp    1160 <dumparray+0x40>
lea    0xea1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [34 x i8] c"static unsigned char %s[256] = {\0A\00"
@.str.1 = [5 x i8] c" \00"
@.str.2 = [5 x i8] c"%s%d\00"
@.str.3 = [25 x i8] c",\09/* 0x%02x - 0x%02x */\0A\00"
@.str.4 = [3 x i8] c", \00"
@str = [4 x i8] c"\0A};\00"
define i32 @dumparray(i8* %0, i8* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %4
4: ; preds = %2, %18
%5 = phi i64 [ 0, %2 ], [ %12, %18 ]
%6 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %19, %18 ]
%7 = trunc i64 %5 to i32
%8 = getelementptr inbounds i8, i8* %1, i64 %5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %10)
%12 = add nuw nsw i64 %5, 1
%13 = and i64 %12, 15
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %4
%16 = add nsw i32 %7, -15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %16, i32 %7)
br label %18
18: ; preds = %4, %15
%19 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %15 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %4 ]
%20 = icmp eq i64 %12, 256
br i1 %20, label %21, label %4
21: ; preds = %18
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 undef
}