#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*/ dump_ozy_buffer(char *, int, unsigned char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void dump_metis_buffer(char *prefix, int frame, unsigned char *buffer) {
  fprintf(stderr, "%s header\n", prefix);
  fprintf(stderr, "  %02X%02X%02X%02X%02X%02X%02X%02X\n", buffer[0], buffer[1],
          buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7]);
  dump_ozy_buffer(prefix, frame, &buffer[8]);
  dump_ozy_buffer(prefix, frame, &buffer[520]);
}


x86 assembly (clang, -O0):
<dump_metis_buffer>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
movzbl (%rax),%edx
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x20(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x20(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    -0x20(%rbp),%rax
movzbl 0x4(%rax),%ebx
mov    -0x20(%rbp),%rax
movzbl 0x5(%rax),%r11d
mov    -0x20(%rbp),%rax
movzbl 0x6(%rax),%r10d
mov    -0x20(%rbp),%rax
movzbl 0x7(%rax),%eax
lea    0xe69(%rip),%rsi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
add    $0x8,%rdx
call   1040 <dump_ozy_buffer@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
add    $0x208,%rdx
call   1040 <dump_ozy_buffer@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_metis_buffer>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r12
mov    0x2ea8(%rip),%r15
mov    (%r15),%edi
lea    0xebe(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
movzbl (%rbx),%edx
movzbl 0x1(%rbx),%ecx
movzbl 0x2(%rbx),%r8d
movzbl 0x3(%rbx),%r9d
movzbl 0x4(%rbx),%r10d
movzbl 0x5(%rbx),%r11d
movzbl 0x6(%rbx),%r15d
movzbl 0x7(%rbx),%ebp
lea    0xe91(%rip),%rsi
xor    %eax,%eax
push   %rbp
push   %r15
push   %r11
push   %r10
call   1030 <fprintf@plt>
add    $0x20,%rsp
lea    0x8(%rbx),%rdx
mov    %r12,%rdi
mov    %r14d,%esi
call   1040 <dump_ozy_buffer@plt>
add    $0x208,%rbx
mov    %r12,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <dump_ozy_buffer@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"%s header\0A\00"
@.str.1 = [36 x i8] c" %02X%02X%02X%02X%02X%02X%02X%02X\0A\00"
define void @dump_metis_buffer(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %6
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 3
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i64 4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i64 5
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i64 6
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8*, i8** %6
%40 = getelementptr inbounds i8, i8* %39, i64 7
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %18, i32 %22, i32 %26, i32 %30, i32 %34, i32 %38, i32 %42)
%44 = load i8*, i8** %4
%45 = load i32, i32* %5
%46 = load i8*, i8** %6
%47 = getelementptr inbounds i8, i8* %46, i64 8
%48 = call i32 @dump_ozy_buffer(i8* %44, i32 %45, i8* %47)
%49 = load i8*, i8** %4
%50 = load i32, i32* %5
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i64 520
%53 = call i32 @dump_ozy_buffer(i8* %49, i32 %50, i8* %52)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"%s header\0A\00"
@.str.1 = [36 x i8] c" %02X%02X%02X%02X%02X%02X%02X%02X\0A\00"
define void @dump_metis_buffer(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds i8, i8* %2, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = getelementptr inbounds i8, i8* %2, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = getelementptr inbounds i8, i8* %2, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = getelementptr inbounds i8, i8* %2, i64 4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = getelementptr inbounds i8, i8* %2, i64 5
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = getelementptr inbounds i8, i8* %2, i64 6
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = getelementptr inbounds i8, i8* %2, i64 7
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %11, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29)
%31 = getelementptr inbounds i8, i8* %2, i64 8
%32 = tail call i32 @dump_ozy_buffer(i8* %0, i32 %1, i8* %31)
%33 = getelementptr inbounds i8, i8* %2, i64 520
%34 = tail call i32 @dump_ozy_buffer(i8* %0, i32 %1, i8* %33)
ret void
}