#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*/ show_file(char const *, void *, unsigned long, char const *);
int /*<<< orphan*/ update_tree_entry(void **, unsigned long *);
void show_tree(const char *prefix, void *tree, unsigned long size,
               const char *base) {
  while (size) {
    show_file(prefix, tree, size, base);
    update_tree_entry(&tree, &size);
  }
}


x86 assembly (clang, -O0):
<show_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <show_tree+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <show_file@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <update_tree_entry@plt>
jmp    1138 <show_tree+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_tree>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %rdx,0x8(%rsp)
test   %rdx,%rdx
je     1195 <show_tree+0x75>
mov    %rcx,%r14
mov    %rdi,%rbx
call   1030 <show_file@plt>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <update_tree_entry@plt>
mov    0x8(%rsp),%rdx
test   %rdx,%rdx
je     1195 <show_tree+0x75>
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r12
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rcx
call   1030 <show_file@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <update_tree_entry@plt>
mov    0x8(%rsp),%rdx
test   %rdx,%rdx
jne    1170 <show_tree+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @show_tree(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
br label %9
9: ; preds = %12, %4
%10 = load i64, i64* %7
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %7
%16 = load i8*, i8** %8
%17 = call i32 @show_file(i8* %13, i8* %14, i64 %15, i8* %16)
%18 = call i32 @update_tree_entry(i8** %6, i64* %7)
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @show_tree(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = icmp eq i64 %2, 0
br i1 %7, label %20, label %8
8: ; preds = %4
%9 = call i32 @show_file(i8* %0, i8* %1, i64 %2, i8* %3)
%10 = call i32 @update_tree_entry(i8** %5, i64* %6)
%11 = load i64, i64* %6
%12 = icmp eq i64 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %8, %13
%14 = phi i64 [ %18, %13 ], [ %11, %8 ]
%15 = load i8*, i8** %5
%16 = call i32 @show_file(i8* %0, i8* %15, i64 %14, i8* %3)
%17 = call i32 @update_tree_entry(i8** %5, i64* %6)
%18 = load i64, i64* %6
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %13
20: ; preds = %13, %8, %4
ret void
}