#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) {
  int i;
  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    $0x48,%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    $0x48,%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*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8*, i8** %6
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i64 4
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = load i8*, i8** %6
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = load i8*, i8** %6
%37 = getelementptr inbounds i8, i8* %36, i64 6
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = load i8*, i8** %6
%41 = getelementptr inbounds i8, i8* %40, i64 7
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %19, i32 %23, i32 %27, i32 %31, i32 %35, i32 %39, i32 %43)
%45 = load i8*, i8** %4
%46 = load i32, i32* %5
%47 = load i8*, i8** %6
%48 = getelementptr inbounds i8, i8* %47, i64 8
%49 = call i32 @dump_ozy_buffer(i8* %45, i32 %46, i8* %48)
%50 = load i8*, i8** %4
%51 = load i32, i32* %5
%52 = load i8*, i8** %6
%53 = getelementptr inbounds i8, i8* %52, i64 520
%54 = call i32 @dump_ozy_buffer(i8* %50, i32 %51, i8* %53)
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
}