#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 */
typedef int uint8_t;

/* Variables and functions */
char *indent(int, int /*<<< orphan*/);
int /*<<< orphan*/ mp4tree_hexdump(int const *, size_t, int);
int /*<<< orphan*/ printf(char *, char *, int const, ...);
void mp4tree_box_iods_print(const uint8_t *p, size_t len, int depth) {
  printf("%s  Version:            %u\n", indent(depth, 0), p[0]);
  printf("%s  Flags:              0x%.2x%.2x%.2x\n", indent(depth, 0), p[1],
         p[2], p[3]);
  mp4tree_hexdump(p, len, depth);
}


x86 assembly (clang, -O0):
<mp4tree_box_iods_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <mp4tree_hexdump@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4tree_box_iods_print>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    (%rbx),%edx
lea    0xeb2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1040 <indent@plt>
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
lea    0xeaa(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <mp4tree_hexdump@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s Version: %u\0A\00"
@.str.1 = [40 x i8] c"%s Flags: 0x%.2x%.2x%.2x\0A\00"
define void @mp4tree_box_iods_print(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i8* @indent(i32 %7, i32 0)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11)
%13 = load i32, i32* %6
%14 = call i8* @indent(i32 %13, i32 0)
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 3
%23 = load i32, i32* %22
%24 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 %17, i32 %20, i32 %23)
%25 = load i32*, i32** %4
%26 = load i64, i64* %5
%27 = load i32, i32* %6
%28 = call i32 @mp4tree_hexdump(i32* %25, i64 %26, i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s Version: %u\0A\00"
@.str.1 = [40 x i8] c"%s Flags: 0x%.2x%.2x%.2x\0A\00"
define void @mp4tree_box_iods_print(i32* %0, i64 %1, i32 %2) {
%4 = tail call i8* @indent(i32 %2, i32 0)
%5 = load i32, i32* %0
%6 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
%7 = tail call i8* @indent(i32 %2, i32 0)
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %9, i32 %11, i32 %13)
%15 = tail call i32 @mp4tree_hexdump(i32* %0, i64 %1, i32 %2)
ret void
}