#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;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int get_u16(int const *);
int get_u24(int const *);
int get_u32(int const *);
char *indent(int, int);
int /*<<< orphan*/ mp4tree_hexdump(int const *, int, int);
char *mp4tree_hexstr(int const *, int);
int /*<<< orphan*/ printf(char *, char *, ...);
void mp4tree_box_uuid_sample_encryption(const uint8_t *p, size_t len,
                                        int depth) {
  const uint32_t flags = get_u24(p + 1);
  uint32_t num_entries = 0;
  uint32_t i = 0;
  uint8_t iv_size = 8;
  printf("%s  Name:        Sample Encryption Box\n", indent(depth, 0));
  printf("%s  Version:     %u\n", indent(depth, 0), p[0]);
  printf("%s  Flags:       0x%.6x\n", indent(depth, 0), flags);
  p += 4;
  if (flags & 1) {
    printf("%s  AlgorithmID: 0x%.2x%.2x%.2x\n", indent(depth, 0), p[0], p[1],
           p[2]);
    printf("%s  IV Sizes:       %u\n", indent(depth, 0), p[3]);
    printf("%s  Key ID:\n", indent(depth, 0));
    mp4tree_hexdump(p + 4, 16, depth);
    p += 20;
  }
  num_entries = get_u32(p);
  p += 4;
  printf("%s  Num Entries: %u\n", indent(depth, 0), num_entries);
  printf("%s  Entry           IV             Entries\n", indent(depth, 0));
  for (i = 0; i < num_entries; i++) {
    if (iv_size) {
      printf("%s Entry: %3u\n", indent(depth, 1), i);
      printf("%s  IV:     %s\n", indent(depth + 1, 0), mp4tree_hexstr(p, 8));
      p += iv_size;
    }
    if (flags & 2) {
      uint32_t j;
      uint16_t num_sub_samples;
      num_sub_samples = get_u16(p);
      printf("%s  Sub-Entries Count: %u\n", indent(depth + 1, 1),
             num_sub_samples);
      p += 2;
      printf("%s  Sub-Entry  BytesOfClear  BytesOfProtectedData\n",
             indent(depth + 2, 0));
      for (j = 0; j < num_sub_samples; j++) {
        printf("%s  %9d  %12u  %20u\n", indent(depth + 2, 0), j, get_u16(p),
               get_u32(p + 2));
        p += 6;
      }
    }
  }
}


x86 assembly (clang, -O0):
<mp4tree_box_uuid_sample_encryption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1080 <get_u24@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x18(%rbp),%edx
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12ab <mp4tree_box_uuid_sample_encryption+0x13b>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%r8d
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edx
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x14(%rbp),%edx
mov    $0x10,%esi
call   1090 <mp4tree_hexdump@plt>
mov    -0x8(%rbp),%rax
add    $0x50,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_u32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x1c(%rbp),%edx
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    147c <mp4tree_box_uuid_sample_encryption+0x30c>
cmpl   $0x0,-0x24(%rbp)
je     1383 <mp4tree_box_uuid_sample_encryption+0x213>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x20(%rbp),%edx
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1050 <mp4tree_hexstr@plt>
mov    -0x38(%rbp),%rsi
mov    %rax,%rdx
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1469 <mp4tree_box_uuid_sample_encryption+0x2f9>
mov    -0x8(%rbp),%rdi
call   1070 <get_u16@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
mov    -0x2c(%rbp),%edx
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%edi
add    $0x2,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rsi
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1464 <mp4tree_box_uuid_sample_encryption+0x2f4>
mov    -0x14(%rbp),%edi
add    $0x2,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <get_u16@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1040 <get_u32@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%edx
mov    -0x3c(%rbp),%ecx
mov    %eax,%r8d
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13f3 <mp4tree_box_uuid_sample_encryption+0x283>
jmp    1469 <mp4tree_box_uuid_sample_encryption+0x2f9>
jmp    146e <mp4tree_box_uuid_sample_encryption+0x2fe>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1303 <mp4tree_box_uuid_sample_encryption+0x193>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp4tree_box_uuid_sample_encryption>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r14d
mov    %rdi,%r12
add    $0x4,%rdi
call   1080 <get_u24@plt>
mov    %eax,%ebx
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe60(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    (%r12),%edx
lea    0xe69(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe63(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,0x1c(%rsp)
test   $0x1,%bl
jne    11f5 <mp4tree_box_uuid_sample_encryption+0x85>
add    $0x10,%r12
jmp    1270 <mp4tree_box_uuid_sample_encryption+0x100>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    0x10(%r12),%edx
mov    0x14(%r12),%ecx
mov    0x18(%r12),%r8d
lea    0xe41(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    0x1c(%r12),%edx
lea    0xe42(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe3f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%r12),%rdi
mov    $0x10,%esi
mov    %r14d,%edx
call   1090 <mp4tree_hexdump@plt>
add    $0x60,%r12
mov    %r12,%rdi
call   1040 <get_u32@plt>
mov    %eax,%r13d
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe10(%rip),%rdi
mov    %rax,%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xe07(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r13d,%r13d
jle    1446 <mp4tree_box_uuid_sample_encryption+0x2d6>
add    $0x10,%r12
lea    0x1(%r14),%r15d
lea    0x2(%r14),%ebp
lea    0xe7a(%rip),%rbx
xor    %eax,%eax
mov    %r14,0x20(%rsp)
mov    %r13d,0x18(%rsp)
mov    %r15d,0x10(%rsp)
mov    %ebp,0x14(%rsp)
jmp    1303 <mp4tree_box_uuid_sample_encryption+0x193>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
add    $0x1,%eax
mov    %rdi,%r12
cmp    %r13d,%eax
je     1446 <mp4tree_box_uuid_sample_encryption+0x2d6>
mov    %r14d,%edi
mov    $0x1,%esi
mov    %eax,%ebp
call   1060 <indent@plt>
lea    0xdc4(%rip),%rdi
mov    %rax,%rsi
mov    %ebp,0xc(%rsp)
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15d,%edi
xor    %esi,%esi
call   1060 <indent@plt>
mov    %rax,%rbp
mov    %r12,%rdi
mov    $0x8,%esi
call   1050 <mp4tree_hexstr@plt>
lea    0xda2(%rip),%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%r12),%rdi
testb  $0x2,0x1c(%rsp)
je     12f0 <mp4tree_box_uuid_sample_encryption+0x180>
call   1070 <get_u16@plt>
mov    %eax,%r14d
mov    %r15d,%edi
mov    $0x1,%esi
call   1060 <indent@plt>
lea    0xd7d(%rip),%rdi
mov    %rax,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x28,%r12
mov    0x14(%rsp),%ebp
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <indent@plt>
lea    0xd73(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r14d,%r14d
jle    1430 <mp4tree_box_uuid_sample_encryption+0x2c0>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
xor    %esi,%esi
mov    %r14d,%ebx
call   1060 <indent@plt>
mov    %rax,%r14
mov    %r12,%rdi
call   1070 <get_u16@plt>
mov    %eax,%r15d
lea    0x8(%r12),%rdi
call   1040 <get_u32@plt>
lea    0xd5f(%rip),%rdi
mov    %r14,%rsi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    0x14(%rsp),%ebp
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%r14d
add    $0x18,%r12
add    $0x1,%r13d
cmp    %r13d,%ebx
jne    13c0 <mp4tree_box_uuid_sample_encryption+0x250>
mov    %r12,%rdi
mov    0x20(%rsp),%r14
mov    0x18(%rsp),%r13d
mov    0x10(%rsp),%r15d
lea    0xd1f(%rip),%rbx
jmp    12f0 <mp4tree_box_uuid_sample_encryption+0x180>
mov    %r12,%rdi
mov    0x10(%rsp),%r15d
mov    0xc(%rsp),%eax
mov    0x20(%rsp),%r14
jmp    12f4 <mp4tree_box_uuid_sample_encryption+0x184>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"%s Name: Sample Encryption Box\0A\00"
@.str.1 = [21 x i8] c"%s Version: %u\0A\00"
@.str.2 = [25 x i8] c"%s Flags: 0x%.6x\0A\00"
@.str.3 = [33 x i8] c"%s AlgorithmID: 0x%.2x%.2x%.2x\0A\00"
@.str.4 = [24 x i8] c"%s IV Sizes: %u\0A\00"
@.str.5 = [13 x i8] c"%s Key ID:\0A\00"
@.str.6 = [21 x i8] c"%s Num Entries: %u\0A\00"
@.str.7 = [44 x i8] c"%s Entry IV Entries\0A\00"
@.str.8 = [15 x i8] c"%s Entry: %3u\0A\00"
@.str.9 = [16 x i8] c"%s IV: %s\0A\00"
@.str.10 = [27 x i8] c"%s Sub-Entries Count: %u\0A\00"
@.str.11 = [51 x i8] c"%s Sub-Entry BytesOfClear BytesOfProtectedData\0A\00"
@.str.12 = [21 x i8] c"%s %9d %12u %20u\0A\00"
define void @mp4tree_box_uuid_sample_encryption(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = call i32 @get_u24(i32* %14)
store i32 %15, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 8, i32* %10
%16 = load i32, i32* %6
%17 = call i8* @indent(i32 %16, i32 0)
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %6
%20 = call i8* @indent(i32 %19, i32 0)
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %20, i32 %23)
%25 = load i32, i32* %6
%26 = call i8* @indent(i32 %25, i32 0)
%27 = load i32, i32* %7
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %26, i32 %27)
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i64 4
store i32* %30, i32** %4
%31 = load i32, i32* %7
%32 = and i32 %31, 1
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %62
34: ; preds = %3
%35 = load i32, i32* %6
%36 = call i8* @indent(i32 %35, i32 0)
%37 = load i32*, i32** %4
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 1
%42 = load i32, i32* %41
%43 = load i32*, i32** %4
%44 = getelementptr inbounds i32, i32* %43, i64 2
%45 = load i32, i32* %44
%46 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %36, i32 %39, i32 %42, i32 %45)
%47 = load i32, i32* %6
%48 = call i8* @indent(i32 %47, i32 0)
%49 = load i32*, i32** %4
%50 = getelementptr inbounds i32, i32* %49, i64 3
%51 = load i32, i32* %50
%52 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %48, i32 %51)
%53 = load i32, i32* %6
%54 = call i8* @indent(i32 %53, i32 0)
%55 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %54)
%56 = load i32*, i32** %4
%57 = getelementptr inbounds i32, i32* %56, i64 4
%58 = load i32, i32* %6
%59 = call i32 @mp4tree_hexdump(i32* %57, i32 16, i32 %58)
%60 = load i32*, i32** %4
%61 = getelementptr inbounds i32, i32* %60, i64 20
store i32* %61, i32** %4
br label %62
62: ; preds = %34, %3
%63 = load i32*, i32** %4
%64 = call i32 @get_u32(i32* %63)
store i32 %64, i32* %8
%65 = load i32*, i32** %4
%66 = getelementptr inbounds i32, i32* %65, i64 4
store i32* %66, i32** %4
%67 = load i32, i32* %6
%68 = call i8* @indent(i32 %67, i32 0)
%69 = load i32, i32* %8
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %68, i32 %69)
%71 = load i32, i32* %6
%72 = call i8* @indent(i32 %71, i32 0)
%73 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i8* %72)
store i32 0, i32* %9
br label %74
74: ; preds = %136, %62
%75 = load i32, i32* %9
%76 = load i32, i32* %8
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %139
78: ; preds = %74
%79 = load i32, i32* %10
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %96
81: ; preds = %78
%82 = load i32, i32* %6
%83 = call i8* @indent(i32 %82, i32 1)
%84 = load i32, i32* %9
%85 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %83, i32 %84)
%86 = load i32, i32* %6
%87 = add nsw i32 %86, 1
%88 = call i8* @indent(i32 %87, i32 0)
%89 = load i32*, i32** %4
%90 = call i8* @mp4tree_hexstr(i32* %89, i32 8)
%91 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %88, i8* %90)
%92 = load i32, i32* %10
%93 = load i32*, i32** %4
%94 = sext i32 %92 to i64
%95 = getelementptr inbounds i32, i32* %93, i64 %94
store i32* %95, i32** %4
br label %96
96: ; preds = %81, %78
%97 = load i32, i32* %7
%98 = and i32 %97, 2
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %135
100: ; preds = %96
%101 = load i32*, i32** %4
%102 = call i32 @get_u16(i32* %101)
store i32 %102, i32* %12
%103 = load i32, i32* %6
%104 = add nsw i32 %103, 1
%105 = call i8* @indent(i32 %104, i32 1)
%106 = load i32, i32* %12
%107 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %105, i32 %106)
%108 = load i32*, i32** %4
%109 = getelementptr inbounds i32, i32* %108, i64 2
store i32* %109, i32** %4
%110 = load i32, i32* %6
%111 = add nsw i32 %110, 2
%112 = call i8* @indent(i32 %111, i32 0)
%113 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0), i8* %112)
store i32 0, i32* %11
br label %114
114: ; preds = %131, %100
%115 = load i32, i32* %11
%116 = load i32, i32* %12
%117 = icmp slt i32 %115, %116
br i1 %117, label %118, label %134
118: ; preds = %114
%119 = load i32, i32* %6
%120 = add nsw i32 %119, 2
%121 = call i8* @indent(i32 %120, i32 0)
%122 = load i32, i32* %11
%123 = load i32*, i32** %4
%124 = call i32 @get_u16(i32* %123)
%125 = load i32*, i32** %4
%126 = getelementptr inbounds i32, i32* %125, i64 2
%127 = call i32 @get_u32(i32* %126)
%128 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %121, i32 %122, i32 %124, i32 %127)
%129 = load i32*, i32** %4
%130 = getelementptr inbounds i32, i32* %129, i64 6
store i32* %130, i32** %4
br label %131
131: ; preds = %118
%132 = load i32, i32* %11
%133 = add nsw i32 %132, 1
store i32 %133, i32* %11
br label %114
134: ; preds = %114
br label %135
135: ; preds = %134, %96
br label %136
136: ; preds = %135
%137 = load i32, i32* %9
%138 = add nsw i32 %137, 1
store i32 %138, i32* %9
br label %74
139: ; preds = %74
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s Name: Sample Encryption Box\0A\00"
@.str.1 = [21 x i8] c"%s Version: %u\0A\00"
@.str.2 = [25 x i8] c"%s Flags: 0x%.6x\0A\00"
@.str.3 = [33 x i8] c"%s AlgorithmID: 0x%.2x%.2x%.2x\0A\00"
@.str.4 = [24 x i8] c"%s IV Sizes: %u\0A\00"
@.str.5 = [13 x i8] c"%s Key ID:\0A\00"
@.str.6 = [21 x i8] c"%s Num Entries: %u\0A\00"
@.str.7 = [44 x i8] c"%s Entry IV Entries\0A\00"
@.str.8 = [15 x i8] c"%s Entry: %3u\0A\00"
@.str.9 = [16 x i8] c"%s IV: %s\0A\00"
@.str.10 = [27 x i8] c"%s Sub-Entries Count: %u\0A\00"
@.str.11 = [51 x i8] c"%s Sub-Entry BytesOfClear BytesOfProtectedData\0A\00"
@.str.12 = [21 x i8] c"%s %9d %12u %20u\0A\00"
define void @mp4tree_box_uuid_sample_encryption(i32* %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @get_u24(i32* %4)
%6 = tail call i8* @indent(i32 %2, i32 0)
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i8* @indent(i32 %2, i32 0)
%9 = load i32, i32* %0
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
%11 = tail call i8* @indent(i32 %2, i32 0)
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %11, i32 %5)
%13 = getelementptr inbounds i32, i32* %0, i64 4
%14 = and i32 %5, 1
%15 = icmp eq i32 %14, 0
br i1 %15, label %33, label %16
16: ; preds = %3
%17 = tail call i8* @indent(i32 %2, i32 0)
%18 = load i32, i32* %13
%19 = getelementptr inbounds i32, i32* %0, i64 5
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %0, i64 6
%22 = load i32, i32* %21
%23 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %17, i32 %18, i32 %20, i32 %22)
%24 = tail call i8* @indent(i32 %2, i32 0)
%25 = getelementptr inbounds i32, i32* %0, i64 7
%26 = load i32, i32* %25
%27 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %24, i32 %26)
%28 = tail call i8* @indent(i32 %2, i32 0)
%29 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds i32, i32* %0, i64 8
%31 = tail call i32 @mp4tree_hexdump(i32* %30, i32 16, i32 %2)
%32 = getelementptr inbounds i32, i32* %0, i64 24
br label %33
33: ; preds = %16, %3
%34 = phi i32* [ %32, %16 ], [ %13, %3 ]
%35 = tail call i32 @get_u32(i32* %34)
%36 = tail call i8* @indent(i32 %2, i32 0)
%37 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %36, i32 %35)
%38 = tail call i8* @indent(i32 %2, i32 0)
%39 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i8* %38)
%40 = icmp sgt i32 %35, 0
br i1 %40, label %41, label %79
41: ; preds = %33
%42 = getelementptr inbounds i32, i32* %34, i64 4
%43 = add nsw i32 %2, 1
%44 = and i32 %5, 2
%45 = icmp eq i32 %44, 0
%46 = add nsw i32 %2, 2
br label %47
47: ; preds = %41, %75
%48 = phi i32* [ %42, %41 ], [ %76, %75 ]
%49 = phi i32 [ 0, %41 ], [ %77, %75 ]
%50 = tail call i8* @indent(i32 %2, i32 1)
%51 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %50, i32 %49)
%52 = tail call i8* @indent(i32 %43, i32 0)
%53 = tail call i8* @mp4tree_hexstr(i32* %48, i32 8)
%54 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %52, i8* %53)
%55 = getelementptr inbounds i32, i32* %48, i64 8
br i1 %45, label %75, label %56
56: ; preds = %47
%57 = tail call i32 @get_u16(i32* %55)
%58 = tail call i8* @indent(i32 %43, i32 1)
%59 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i8* %58, i32 %57)
%60 = getelementptr inbounds i32, i32* %48, i64 10
%61 = tail call i8* @indent(i32 %46, i32 0)
%62 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.11, i64 0, i64 0), i8* %61)
%63 = icmp sgt i32 %57, 0
br i1 %63, label %64, label %75
64: ; preds = %56, %64
%65 = phi i32* [ %72, %64 ], [ %60, %56 ]
%66 = phi i32 [ %73, %64 ], [ 0, %56 ]
%67 = tail call i8* @indent(i32 %46, i32 0)
%68 = tail call i32 @get_u16(i32* %65)
%69 = getelementptr inbounds i32, i32* %65, i64 2
%70 = tail call i32 @get_u32(i32* %69)
%71 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i8* %67, i32 %66, i32 %68, i32 %70)
%72 = getelementptr inbounds i32, i32* %65, i64 6
%73 = add nuw nsw i32 %66, 1
%74 = icmp eq i32 %73, %57
br i1 %74, label %75, label %64
75: ; preds = %64, %56, %47
%76 = phi i32* [ %55, %47 ], [ %60, %56 ], [ %72, %64 ]
%77 = add nuw nsw i32 %49, 1
%78 = icmp eq i32 %77, %35
br i1 %78, label %79, label %47
79: ; preds = %75, %33
ret void
}