#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 */
int get_u32(int const *);
char *indent(int, int /*<<< orphan*/);
int /*<<< orphan*/ mp4tree_table_print(char *, char *, int const *, int, int,
                                       int const, int);
int /*<<< orphan*/ printf(char *, char *, int const, ...);
void mp4tree_box_stsz_print(const uint8_t *p, size_t len, int depth) {
  const int sample_size = get_u32(p + 4);
  const int num = get_u32(p + 8);
  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]);
  printf("%s  Sample size: %u\n", indent(depth, 0), sample_size);
  printf("%s  Num Entries: %u\n", indent(depth, 0), num);
  mp4tree_table_print("Sample size table", "Size", p + 12, 4, 1, num, depth);
}


x86 assembly (clang, -O0):
<mp4tree_box_stsz_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
call   1050 <get_u32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
call   1050 <get_u32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <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    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x18(%rbp),%edx
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x1c(%rbp),%edx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdx
add    $0x30,%rdx
mov    -0x1c(%rbp),%r9d
mov    -0x14(%rbp),%eax
lea    0xe49(%rip),%rdi
lea    0xe54(%rip),%rsi
mov    $0x4,%ecx
mov    $0x1,%r8d
mov    %eax,(%rsp)
call   1030 <mp4tree_table_print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4tree_box_stsz_print>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
add    $0x10,%rdi
call   1050 <get_u32@plt>
mov    %eax,%r15d
lea    0x20(%rbx),%rdi
call   1050 <get_u32@plt>
mov    %eax,%r14d
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    (%rbx),%edx
lea    0xe8a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
lea    0xe7b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe82(%rip),%rdi
mov    %rax,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe7a(%rip),%rdi
mov    %rax,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x30,%rbx
mov    %ebp,(%rsp)
lea    0xe74(%rip),%rdi
lea    0xe7f(%rip),%rsi
mov    %rbx,%rdx
mov    $0x4,%ecx
mov    $0x1,%r8d
mov    %r14d,%r9d
call   1030 <mp4tree_table_print@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s Version: %u\0A\00"
@.str.1 = [33 x i8] c"%s Flags: 0x%.2x%.2x%.2x\0A\00"
@.str.2 = [21 x i8] c"%s Sample size: %u\0A\00"
@.str.3 = [21 x i8] c"%s Num Entries: %u\0A\00"
@.str.4 = [18 x i8] c"Sample size table\00"
@.str.5 = [5 x i8] c"Size\00"
define void @mp4tree_box_stsz_print(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = call i32 @get_u32(i32* %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 8
%14 = call i32 @get_u32(i32* %13)
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = call i8* @indent(i32 %15, i32 0)
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %16, i32 %19)
%21 = load i32, i32* %6
%22 = call i8* @indent(i32 %21, i32 0)
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i64 2
%28 = load i32, i32* %27
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %22, i32 %25, i32 %28, i32 %31)
%33 = load i32, i32* %6
%34 = call i8* @indent(i32 %33, i32 0)
%35 = load i32, i32* %7
%36 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %34, i32 %35)
%37 = load i32, i32* %6
%38 = call i8* @indent(i32 %37, i32 0)
%39 = load i32, i32* %8
%40 = call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %38, i32 %39)
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 12
%43 = load i32, i32* %8
%44 = load i32, i32* %6
%45 = call i32 @mp4tree_table_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %42, i32 4, i32 1, i32 %43, i32 %44)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s Version: %u\0A\00"
@.str.1 = [33 x i8] c"%s Flags: 0x%.2x%.2x%.2x\0A\00"
@.str.2 = [21 x i8] c"%s Sample size: %u\0A\00"
@.str.3 = [21 x i8] c"%s Num Entries: %u\0A\00"
@.str.4 = [18 x i8] c"Sample size table\00"
@.str.5 = [5 x i8] c"Size\00"
define void @mp4tree_box_stsz_print(i32* %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = tail call i32 @get_u32(i32* %4)
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = tail call i32 @get_u32(i32* %6)
%8 = tail call i8* @indent(i32 %2, i32 0)
%9 = load i32, i32* %0
%10 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = tail call i8* @indent(i32 %2, i32 0)
%12 = getelementptr inbounds i32, i32* %0, i64 1
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %0, i64 2
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %0, i64 3
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %13, i32 %15, i32 %17)
%19 = tail call i8* @indent(i32 %2, i32 0)
%20 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %19, i32 %5)
%21 = tail call i8* @indent(i32 %2, i32 0)
%22 = tail call i32 (i8*, i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %21, i32 %7)
%23 = getelementptr inbounds i32, i32* %0, i64 12
%24 = tail call i32 @mp4tree_table_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32* %23, i32 4, i32 1, i32 %7, i32 %2)
ret void
}