#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(unsigned char *x, int sections) {
  int i;
  printf("unsigned char bootblock[] = {\n");
  for (i = 0; i < sections; i++) {
    printf("\t0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, "
           "0x%02x,\n\t0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, "
           "0x%02x,\n",
           x[0], x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10],
           x[11], x[12], x[13], x[14], x[15]);
    x += 16;
  }
  printf("};\n");
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    123b <dump+0x12b>
mov    -0x30(%rbp),%rax
movzbl (%rax),%esi
mov    -0x30(%rbp),%rax
movzbl 0x1(%rax),%edx
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%ecx
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%r8d
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%r9d
mov    -0x30(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    -0x30(%rbp),%rdi
movzbl 0x6(%rdi),%edi
mov    %edi,-0x44(%rbp)
mov    -0x30(%rbp),%rdi
movzbl 0x7(%rdi),%edi
mov    %edi,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
movzbl 0x8(%rdi),%r13d
mov    -0x30(%rbp),%rdi
movzbl 0x9(%rdi),%r12d
mov    -0x30(%rbp),%rdi
movzbl 0xa(%rdi),%r15d
mov    -0x30(%rbp),%rdi
movzbl 0xb(%rdi),%r14d
mov    -0x30(%rbp),%rdi
movzbl 0xc(%rdi),%ebx
mov    -0x30(%rbp),%rdi
movzbl 0xd(%rdi),%r11d
mov    -0x30(%rbp),%rdi
movzbl 0xe(%rdi),%r10d
mov    -0x30(%rbp),%rdi
movzbl 0xf(%rdi),%edi
mov    %edi,-0x3c(%rbp)
lea    0xe3f(%rip),%rdi
mov    %eax,(%rsp)
mov    -0x44(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x40(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x3c(%rbp),%eax
mov    %r13d,0x18(%rsp)
mov    %r12d,0x20(%rsp)
mov    %r15d,0x28(%rsp)
mov    %r14d,0x30(%rsp)
mov    %ebx,0x38(%rsp)
mov    %r11d,0x40(%rsp)
mov    %r10d,0x48(%rsp)
mov    %eax,0x50(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    113d <dump+0x2d>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    11f2 <dump+0xd2>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%esi
movzbl 0x1(%rbx),%edx
movzbl 0x2(%rbx),%ecx
movzbl 0x3(%rbx),%r8d
movzbl 0x4(%rbx),%r9d
movzbl 0x5(%rbx),%eax
mov    %rax,0x20(%rsp)
movzbl 0x6(%rbx),%eax
mov    %rax,0x18(%rsp)
movzbl 0x7(%rbx),%eax
mov    %rax,0x10(%rsp)
movzbl 0x8(%rbx),%eax
mov    %rax,0x8(%rsp)
movzbl 0x9(%rbx),%eax
mov    %rax,(%rsp)
movzbl 0xa(%rbx),%r14d
movzbl 0xb(%rbx),%r10d
movzbl 0xc(%rbx),%r11d
movzbl 0xd(%rbx),%r15d
movzbl 0xe(%rbx),%r12d
movzbl 0xf(%rbx),%r13d
sub    $0x8,%rsp
lea    0xe46(%rip),%rdi
xor    %eax,%eax
push   %r13
push   %r12
push   %r15
push   %r11
push   %r10
push   %r14
push   0x38(%rsp)
push   0x48(%rsp)
push   0x58(%rsp)
push   0x68(%rsp)
push   0x78(%rsp)
call   1040 <printf@plt>
add    $0x60,%rsp
add    $0x10,%rbx
add    $0xffffffff,%ebp
jne    1150 <dump+0x30>
lea    0xea8(%rip),%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"unsigned char bootblock[] = {\0A\00"
@.str.1 = [131 x i8] c"\090x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\090x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@.str.2 = [4 x i8] c"};\0A\00"
define void @dump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %79, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %82
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 6
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 7
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i64 8
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = load i8*, i8** %3
%49 = getelementptr inbounds i8, i8* %48, i64 9
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = load i8*, i8** %3
%53 = getelementptr inbounds i8, i8* %52, i64 10
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = load i8*, i8** %3
%57 = getelementptr inbounds i8, i8* %56, i64 11
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 12
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 13
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = load i8*, i8** %3
%69 = getelementptr inbounds i8, i8* %68, i64 14
%70 = load i8, i8* %69
%71 = zext i8 %70 to i32
%72 = load i8*, i8** %3
%73 = getelementptr inbounds i8, i8* %72, i64 15
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %19, i32 %23, i32 %27, i32 %31, i32 %35, i32 %39, i32 %43, i32 %47, i32 %51, i32 %55, i32 %59, i32 %63, i32 %67, i32 %71, i32 %75)
%77 = load i8*, i8** %3
%78 = getelementptr inbounds i8, i8* %77, i64 16
store i8* %78, i8** %3
br label %79
79: ; preds = %11
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
br label %7
82: ; preds = %7
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [131 x i8] c"\090x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\090x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x,\0A\00"
@str = [30 x i8] c"unsigned char bootblock[] = {\00"
@str.3 = [3 x i8] c"};\00"
define void @dump(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %59
5: ; preds = %2, %5
%6 = phi i32 [ %57, %5 ], [ 0, %2 ]
%7 = phi i8* [ %56, %5 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = getelementptr inbounds i8, i8* %7, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = getelementptr inbounds i8, i8* %7, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = getelementptr inbounds i8, i8* %7, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = getelementptr inbounds i8, i8* %7, i64 5
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = getelementptr inbounds i8, i8* %7, i64 6
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = getelementptr inbounds i8, i8* %7, i64 7
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds i8, i8* %7, i64 8
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = getelementptr inbounds i8, i8* %7, i64 9
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = getelementptr inbounds i8, i8* %7, i64 10
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = getelementptr inbounds i8, i8* %7, i64 11
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = getelementptr inbounds i8, i8* %7, i64 12
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = getelementptr inbounds i8, i8* %7, i64 13
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = getelementptr inbounds i8, i8* %7, i64 14
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = getelementptr inbounds i8, i8* %7, i64 15
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %12, i32 %15, i32 %18, i32 %21, i32 %24, i32 %27, i32 %30, i32 %33, i32 %36, i32 %39, i32 %42, i32 %45, i32 %48, i32 %51, i32 %54)
%56 = getelementptr inbounds i8, i8* %7, i64 16
%57 = add nuw nsw i32 %6, 1
%58 = icmp eq i32 %57, %1
br i1 %58, label %59, label %5
59: ; preds = %5, %2
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
ret void
}