#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int, int);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, int, int, char const *, char *);
int read32(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ stderr;
int traverse(FILE *inbst, int bstoff, FILE *inbstn, int bstnoff,
             const char *dirname, int leafaddr) {
  char filename[256];
  char buf[256];
  int count;
  int i;
  int leaf = 0;
  memset(filename, 0, 256);
  if (leafaddr) {
    int next;
    fseek(inbstn, bstnoff, SEEK_SET);
    fread(filename, 1, 256 - 1, inbstn);
    fseek(inbst, bstoff & 0xffffff, SEEK_SET);
    fread(buf, 1, 4, inbst);
    printf("[%08x]=%08x=%08x\t%s%s\n", leafaddr, bstoff, read32(buf), dirname,
           filename);
    return 0;
  }
  fseek(inbst, bstoff, SEEK_SET);
  fseek(inbstn, bstnoff, SEEK_SET);
  fread(buf, 1, 4, inbst);
  bstoff += 4;
  count = read32(buf);
  fread(buf, 1, 4, inbstn);
  bstnoff += 4;
  if (read32(buf) != count) {
    fprintf(stderr, "inconsistency with %s subdirectory count, %d!=%d\n",
            dirname, read32(buf), count);
    return 1;
  }
  fread(buf, 1, 4, inbst);
  bstoff += 4;
  if (!read32(buf))
    leaf = 1;
  else
    bstoff -= 4;
  if (dirname) {
    int nameoff;
    fread(buf, 1, 4, inbstn);
    bstnoff += 4;
    nameoff = read32(buf);
    fseek(inbstn, nameoff, SEEK_SET);
    fread(buf, 1, 256, inbstn);
    buf[256 - 1] = '\0';
    snprintf(filename, 256 - 1, "%s%s/", dirname, buf);
  } else {
    snprintf(filename, 256 - 1, "/");
  }
  for (i = 0; i < count; i++) {
    int nextbstoff, nextbstnoff;
    fseek(inbst, bstoff + i * 4, SEEK_SET);
    fseek(inbstn, bstnoff + i * 4, SEEK_SET);
    fread(buf, 1, 4, inbst);
    nextbstoff = read32(buf);
    fread(buf, 1, 4, inbstn);
    nextbstnoff = read32(buf);
    if (leaf) {
      if (traverse(inbst, nextbstoff, inbstn, nextbstnoff, filename,
                   bstoff + i * 4))
        return 1;
    } else {
      if (traverse(inbst, nextbstoff, inbstn, nextbstnoff, filename, 0))
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<traverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
movl   $0x0,-0x24c(%rbp)
lea    -0x140(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
cmpl   $0x0,-0x34(%rbp)
je     127b <traverse+0xfb>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2e02(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0x140(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0xff,%edx
call   1030 <fread@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
and    $0xffffff,%esi
mov    0x2dcd(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x264(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x260(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    -0x264(%rbp),%esi
mov    -0x260(%rbp),%edx
mov    %eax,%ecx
mov    -0x30(%rbp),%r8
lea    -0x140(%rbp),%r9
lea    0xd96(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    15de <traverse+0x45e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2d4f(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    0x2d3a(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    %eax,-0x244(%rbp)
lea    -0x240(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x24(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x24(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
cmp    -0x244(%rbp),%eax
je     1369 <traverse+0x1e9>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x274(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x270(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    -0x274(%rbp),%edi
mov    -0x270(%rbp),%rdx
mov    %eax,%ecx
mov    -0x244(%rbp),%r8d
lea    0xcbf(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    15de <traverse+0x45e>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
cmp    $0x0,%eax
jne    13b0 <traverse+0x230>
movl   $0x1,-0x24c(%rbp)
jmp    13b9 <traverse+0x239>
mov    -0x14(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     145c <traverse+0x2dc>
lea    -0x240(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
mov    -0x24(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x24(%rbp)
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    %eax,-0x254(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x254(%rbp),%esi
mov    0x2bce(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0x240(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100,%edx
call   1030 <fread@plt>
movb   $0x0,-0x141(%rbp)
lea    -0x140(%rbp),%rdi
mov    -0x30(%rbp),%rcx
lea    -0x240(%rbp),%r8
mov    $0xff,%esi
lea    0xbf9(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
jmp    1476 <traverse+0x2f6>
lea    -0x140(%rbp),%rdi
mov    $0xff,%esi
lea    0xbde(%rip),%rdx
mov    $0x0,%al
call   1050 <snprintf@plt>
movl   $0x0,-0x248(%rbp)
mov    -0x248(%rbp),%eax
cmp    -0x244(%rbp),%eax
jge    15d7 <traverse+0x457>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x248(%rbp),%eax
shl    $0x2,%eax
add    %eax,%esi
mov    0x2b2d(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x248(%rbp),%eax
shl    $0x2,%eax
add    %eax,%esi
mov    0x2b0d(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
lea    -0x240(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    %eax,-0x258(%rbp)
lea    -0x240(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
lea    -0x240(%rbp),%rdi
call   10a0 <read32@plt>
mov    %eax,-0x25c(%rbp)
cmpl   $0x0,-0x24c(%rbp)
je     1581 <traverse+0x401>
mov    -0x10(%rbp),%rdi
mov    -0x258(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x25c(%rbp),%ecx
lea    -0x140(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    -0x248(%rbp),%eax
shl    $0x2,%eax
add    %eax,%r9d
call   1060 <traverse@plt>
cmp    $0x0,%eax
je     157c <traverse+0x3fc>
movl   $0x1,-0x4(%rbp)
jmp    15de <traverse+0x45e>
jmp    15be <traverse+0x43e>
mov    -0x10(%rbp),%rdi
mov    -0x258(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x25c(%rbp),%ecx
lea    -0x140(%rbp),%r8
xor    %r9d,%r9d
call   1060 <traverse@plt>
cmp    $0x0,%eax
je     15b9 <traverse+0x439>
movl   $0x1,-0x4(%rbp)
jmp    15de <traverse+0x45e>
jmp    15be <traverse+0x43e>
jmp    15c3 <traverse+0x443>
mov    -0x248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x248(%rbp)
jmp    1480 <traverse+0x300>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traverse>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
mov    %r9d,%r12d
mov    %r8,0x8(%rsp)
mov    %ecx,%r13d
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x130(%rsp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1070 <memset@plt>
mov    0x2e18(%rip),%rbx
mov    (%rbx),%edx
test   %r12d,%r12d
je     124c <traverse+0xcc>
mov    %rbp,%rdi
mov    %r13d,%esi
call   1090 <fseek@plt>
mov    %rbp,%rcx
mov    %r14,%rbp
lea    0x130(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0xff,%edx
call   1030 <fread@plt>
mov    %ebp,%esi
and    $0xffffff,%esi
mov    (%rbx),%edx
mov    %r15,%rdi
call   1090 <fseek@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   10a0 <read32@plt>
lea    0xdcf(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
mov    0x8(%rsp),%r8
mov    %r14,%r9
call   1040 <printf@plt>
xor    %eax,%eax
jmp    14ce <traverse+0x34e>
mov    %r15,%rdi
mov    %r14,0x18(%rsp)
mov    %r14d,%esi
call   1090 <fseek@plt>
mov    (%rbx),%edx
mov    %rbp,%rdi
mov    %r13d,%esi
call   1090 <fseek@plt>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %r14,%rdi
call   10a0 <read32@plt>
mov    %eax,%r12d
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbp,0x20(%rsp)
mov    %rbp,%rcx
call   1030 <fread@plt>
mov    %r14,%rdi
call   10a0 <read32@plt>
cmp    %r12d,%eax
jne    1383 <traverse+0x203>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,0x28(%rsp)
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %r14,%rdi
call   10a0 <read32@plt>
xor    %r15d,%r15d
mov    %eax,0x14(%rsp)
test   %eax,%eax
sete   %bpl
mov    0x8(%rsp),%rbx
test   %rbx,%rbx
je     13b8 <traverse+0x238>
lea    0x30(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %bpl,0x7(%rsp)
mov    0x20(%rsp),%rbp
mov    %rbp,%rcx
call   1030 <fread@plt>
add    $0x8,%r13d
mov    %r14,%rdi
call   10a0 <read32@plt>
mov    0x2ca6(%rip),%rcx
mov    (%rcx),%edx
mov    %rbp,%rdi
mov    %eax,%esi
call   1090 <fseek@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x100,%edx
mov    %rbp,%rcx
mov    0x7(%rsp),%bpl
call   1030 <fread@plt>
movb   $0x0,0x12f(%rsp)
lea    0xce2(%rip),%rdx
lea    0x130(%rsp),%rdi
mov    $0xff,%esi
mov    %rbx,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    13d7 <traverse+0x257>
mov    0x2c56(%rip),%rax
mov    (%rax),%ebx
lea    0x30(%rsp),%rdi
call   10a0 <read32@plt>
lea    0xc7a(%rip),%rsi
mov    %ebx,%edi
mov    0x8(%rsp),%rdx
mov    %eax,%ecx
mov    %r12d,%r8d
call   1080 <fprintf@plt>
mov    $0x1,%eax
jmp    14ce <traverse+0x34e>
add    $0x4,%r13d
lea    0xc8a(%rip),%rdx
lea    0x130(%rsp),%rdi
mov    $0xff,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
mov    0x18(%rsp),%rcx
test   %r12d,%r12d
mov    $0x0,%eax
jle    14ce <traverse+0x34e>
mov    %bpl,%r15b
lea    (%rcx,%r15,4),%ebx
add    $0x4,%ebx
mov    0x20(%rsp),%rbp
mov    0x28(%rsp),%r15
xchg   %ax,%ax
mov    %r12d,0x8(%rsp)
mov    0x2bcc(%rip),%r14
mov    (%r14),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1090 <fseek@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    %r13d,%esi
call   1090 <fseek@plt>
lea    0x30(%rsp),%r12
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %r15,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
call   10a0 <read32@plt>
mov    %eax,%r14d
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbp,%rcx
call   1030 <fread@plt>
mov    %r12,%rdi
call   10a0 <read32@plt>
cmpl   $0x0,0x14(%rsp)
je     1490 <traverse+0x310>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    %eax,%ecx
lea    0x130(%rsp),%r8
xor    %r9d,%r9d
jmp    14a6 <traverse+0x326>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    %eax,%ecx
lea    0x130(%rsp),%r8
mov    %ebx,%r9d
call   1060 <traverse@plt>
test   %eax,%eax
mov    0x8(%rsp),%r12d
jne    13ae <traverse+0x22e>
add    $0x4,%ebx
add    $0x4,%r13d
add    $0xffffffff,%r12d
jne    1400 <traverse+0x280>
jmp    1245 <traverse+0xc5>
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [23 x i8] c"[%08x]=%08x=%08x\09%s%s\0A\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"inconsistency with %s subdirectory count, %d!=%d\0A\00"
@.str.2 = [6 x i8] c"%s%s/\00"
@.str.3 = [2 x i8] c"/\00"
define i32 @traverse(i32* %0, i32 %1, i32* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca [256 x i8]
%15 = alloca [256 x i8]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32* %2, i32** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32 0, i32* %18
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%24 = call i32 @memset(i8* %23, i32 0, i32 256)
%25 = load i32, i32* %13
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %50
27: ; preds = %6
%28 = load i32*, i32** %10
%29 = load i32, i32* %11
%30 = load i32, i32* @SEEK_SET
%31 = call i32 @fseek(i32* %28, i32 %29, i32 %30)
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%33 = load i32*, i32** %10
%34 = call i32 @fread(i8* %32, i32 1, i32 255, i32* %33)
%35 = load i32*, i32** %8
%36 = load i32, i32* %9
%37 = and i32 %36, 16777215
%38 = load i32, i32* @SEEK_SET
%39 = call i32 @fseek(i32* %35, i32 %37, i32 %38)
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%41 = load i32*, i32** %8
%42 = call i32 @fread(i8* %40, i32 1, i32 4, i32* %41)
%43 = load i32, i32* %13
%44 = load i32, i32* %9
%45 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%46 = call i32 @read32(i8* %45)
%47 = load i8*, i8** %12
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%49 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i32 %46, i8* %47, i8* %48)
store i32 0, i32* %7
br label %182
50: ; preds = %6
%51 = load i32*, i32** %8
%52 = load i32, i32* %9
%53 = load i32, i32* @SEEK_SET
%54 = call i32 @fseek(i32* %51, i32 %52, i32 %53)
%55 = load i32*, i32** %10
%56 = load i32, i32* %11
%57 = load i32, i32* @SEEK_SET
%58 = call i32 @fseek(i32* %55, i32 %56, i32 %57)
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%60 = load i32*, i32** %8
%61 = call i32 @fread(i8* %59, i32 1, i32 4, i32* %60)
%62 = load i32, i32* %9
%63 = add nsw i32 %62, 4
store i32 %63, i32* %9
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%65 = call i32 @read32(i8* %64)
store i32 %65, i32* %16
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%67 = load i32*, i32** %10
%68 = call i32 @fread(i8* %66, i32 1, i32 4, i32* %67)
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 4
store i32 %70, i32* %11
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%72 = call i32 @read32(i8* %71)
%73 = load i32, i32* %16
%74 = icmp ne i32 %72, %73
br i1 %74, label %75, label %82
75: ; preds = %50
%76 = load i32, i32* @stderr
%77 = load i8*, i8** %12
%78 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%79 = call i32 @read32(i8* %78)
%80 = load i32, i32* %16
%81 = call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %77, i32 %79, i32 %80)
store i32 1, i32* %7
br label %182
82: ; preds = %50
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%84 = load i32*, i32** %8
%85 = call i32 @fread(i8* %83, i32 1, i32 4, i32* %84)
%86 = load i32, i32* %9
%87 = add nsw i32 %86, 4
store i32 %87, i32* %9
%88 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%89 = call i32 @read32(i8* %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %92, label %91
91: ; preds = %82
store i32 1, i32* %18
br label %95
92: ; preds = %82
%93 = load i32, i32* %9
%94 = sub nsw i32 %93, 4
store i32 %94, i32* %9
br label %95
95: ; preds = %92, %91
%96 = load i8*, i8** %12
%97 = icmp ne i8* %96, null
br i1 %97, label %98, label %118
98: ; preds = %95
%99 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%100 = load i32*, i32** %10
%101 = call i32 @fread(i8* %99, i32 1, i32 4, i32* %100)
%102 = load i32, i32* %11
%103 = add nsw i32 %102, 4
store i32 %103, i32* %11
%104 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%105 = call i32 @read32(i8* %104)
store i32 %105, i32* %20
%106 = load i32*, i32** %10
%107 = load i32, i32* %20
%108 = load i32, i32* @SEEK_SET
%109 = call i32 @fseek(i32* %106, i32 %107, i32 %108)
%110 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%111 = load i32*, i32** %10
%112 = call i32 @fread(i8* %110, i32 1, i32 256, i32* %111)
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 255
store i8 0, i8* %113
%114 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%115 = load i8*, i8** %12
%116 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%117 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %114, i32 255, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %115, i8* %116)
br label %121
118: ; preds = %95
%119 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%120 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %119, i32 255, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %121
121: ; preds = %118, %98
store i32 0, i32* %17
br label %122
122: ; preds = %178, %121
%123 = load i32, i32* %17
%124 = load i32, i32* %16
%125 = icmp slt i32 %123, %124
br i1 %125, label %126, label %181
126: ; preds = %122
%127 = load i32*, i32** %8
%128 = load i32, i32* %9
%129 = load i32, i32* %17
%130 = mul nsw i32 %129, 4
%131 = add nsw i32 %128, %130
%132 = load i32, i32* @SEEK_SET
%133 = call i32 @fseek(i32* %127, i32 %131, i32 %132)
%134 = load i32*, i32** %10
%135 = load i32, i32* %11
%136 = load i32, i32* %17
%137 = mul nsw i32 %136, 4
%138 = add nsw i32 %135, %137
%139 = load i32, i32* @SEEK_SET
%140 = call i32 @fseek(i32* %134, i32 %138, i32 %139)
%141 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%142 = load i32*, i32** %8
%143 = call i32 @fread(i8* %141, i32 1, i32 4, i32* %142)
%144 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%145 = call i32 @read32(i8* %144)
store i32 %145, i32* %21
%146 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%147 = load i32*, i32** %10
%148 = call i32 @fread(i8* %146, i32 1, i32 4, i32* %147)
%149 = getelementptr inbounds [256 x i8], [256 x i8]* %15, i64 0, i64 0
%150 = call i32 @read32(i8* %149)
store i32 %150, i32* %22
%151 = load i32, i32* %18
%152 = icmp ne i32 %151, 0
br i1 %152, label %153, label %167
153: ; preds = %126
%154 = load i32*, i32** %8
%155 = load i32, i32* %21
%156 = load i32*, i32** %10
%157 = load i32, i32* %22
%158 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%159 = load i32, i32* %9
%160 = load i32, i32* %17
%161 = mul nsw i32 %160, 4
%162 = add nsw i32 %159, %161
%163 = call i32 @traverse(i32* %154, i32 %155, i32* %156, i32 %157, i8* %158, i32 %162)
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %166
165: ; preds = %153
store i32 1, i32* %7
br label %182
166: ; preds = %153
br label %177
167: ; preds = %126
%168 = load i32*, i32** %8
%169 = load i32, i32* %21
%170 = load i32*, i32** %10
%171 = load i32, i32* %22
%172 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%173 = call i32 @traverse(i32* %168, i32 %169, i32* %170, i32 %171, i8* %172, i32 0)
%174 = icmp ne i32 %173, 0
br i1 %174, label %175, label %176
175: ; preds = %167
store i32 1, i32* %7
br label %182
176: ; preds = %167
br label %177
177: ; preds = %176, %166
br label %178
178: ; preds = %177
%179 = load i32, i32* %17
%180 = add nsw i32 %179, 1
store i32 %180, i32* %17
br label %122
181: ; preds = %122
store i32 0, i32* %7
br label %182
182: ; preds = %181, %175, %165, %75, %27
%183 = load i32, i32* %7
ret i32 %183
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [23 x i8] c"[%08x]=%08x=%08x\09%s%s\0A\00"
@stderr = global i32 0
@.str.1 = [50 x i8] c"inconsistency with %s subdirectory count, %d!=%d\0A\00"
@.str.2 = [6 x i8] c"%s%s/\00"
@.str.3 = [2 x i8] c"/\00"
define i32 @traverse(i32* %0, i32 %1, i32* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca [256 x i8]
%8 = alloca [256 x i8]
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%11 = call i32 @memset(i8* %9, i32 0, i32 256)
%12 = icmp eq i32 %5, 0
%13 = load i32, i32* @SEEK_SET
br i1 %12, label %23, label %14
14: ; preds = %6
%15 = call i32 @fseek(i32* %2, i32 %3, i32 %13)
%16 = call i32 @fread(i8* %9, i32 1, i32 255, i32* %2)
%17 = and i32 %1, 16777215
%18 = load i32, i32* @SEEK_SET
%19 = call i32 @fseek(i32* %0, i32 %17, i32 %18)
%20 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %0)
%21 = call i32 @read32(i8* %10)
%22 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %21, i8* %4, i8* %9)
br label %80
23: ; preds = %6
%24 = call i32 @fseek(i32* %0, i32 %1, i32 %13)
%25 = load i32, i32* @SEEK_SET
%26 = call i32 @fseek(i32* %2, i32 %3, i32 %25)
%27 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %0)
%28 = call i32 @read32(i8* %10)
%29 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %2)
%30 = add nsw i32 %3, 4
%31 = call i32 @read32(i8* %10)
%32 = icmp eq i32 %31, %28
br i1 %32, label %37, label %33
33: ; preds = %23
%34 = load i32, i32* @stderr
%35 = call i32 @read32(i8* %10)
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 %35, i32 %28)
br label %80
37: ; preds = %23
%38 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %0)
%39 = call i32 @read32(i8* %10)
%40 = icmp eq i32 %39, 0
%41 = select i1 %40, i32 8, i32 4
%42 = add nsw i32 %41, %1
%43 = icmp eq i8* %4, null
br i1 %43, label %53, label %44
44: ; preds = %37
%45 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %2)
%46 = add nsw i32 %3, 8
%47 = call i32 @read32(i8* %10)
%48 = load i32, i32* @SEEK_SET
%49 = call i32 @fseek(i32* %2, i32 %47, i32 %48)
%50 = call i32 @fread(i8* %10, i32 1, i32 256, i32* %2)
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 255
store i8 0, i8* %51
%52 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %9, i32 255, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %10)
br label %55
53: ; preds = %37
%54 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %9, i32 255, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %55
55: ; preds = %53, %44
%56 = phi i32 [ %46, %44 ], [ %30, %53 ]
%57 = icmp sgt i32 %28, 0
br i1 %57, label %58, label %80
58: ; preds = %55, %77
%59 = phi i32 [ %78, %77 ], [ 0, %55 ]
%60 = shl nsw i32 %59, 2
%61 = add nsw i32 %42, %60
%62 = load i32, i32* @SEEK_SET
%63 = call i32 @fseek(i32* %0, i32 %61, i32 %62)
%64 = add nsw i32 %60, %56
%65 = load i32, i32* @SEEK_SET
%66 = call i32 @fseek(i32* %2, i32 %64, i32 %65)
%67 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %0)
%68 = call i32 @read32(i8* %10)
%69 = call i32 @fread(i8* %10, i32 1, i32 4, i32* %2)
%70 = call i32 @read32(i8* %10)
br i1 %40, label %71, label %74
71: ; preds = %58
%72 = call i32 @traverse(i32* %0, i32 %68, i32* %2, i32 %70, i8* %9, i32 %61)
%73 = icmp eq i32 %72, 0
br i1 %73, label %77, label %80
74: ; preds = %58
%75 = call i32 @traverse(i32* %0, i32 %68, i32* %2, i32 %70, i8* %9, i32 0)
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %71, %74
%78 = add nuw nsw i32 %59, 1
%79 = icmp eq i32 %78, %28
br i1 %79, label %80, label %58
80: ; preds = %74, %71, %77, %55, %33, %14
%81 = phi i32 [ 0, %14 ], [ 1, %33 ], [ 0, %55 ], [ 1, %74 ], [ 1, %71 ], [ 0, %77 ]
ret i32 %81
}