LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: bool t2::LoadFrozenData<t2::StateData>(char const*, t2::MemoryMappedFile*, t2::StateData const**)
static bool LoadFrozenData(const char* fn, MemoryMappedFile* result, const FrozenType** ptr)
{
  MemoryMappedFile mapping;

  MmapFileInit(&mapping);

  MmapFileMap(&mapping, fn);

  if (MmapFileValid(&mapping))
  {
    char *mmap_buffer = static_cast<char*>(mapping.m_Address);
    const FrozenType* data = reinterpret_cast<const FrozenType*>(mmap_buffer);

    Log(kDebug, "%s: successfully mapped at %p (%d bytes)", fn, data, (int) mapping.m_Size);

    // Check size
    if (mapping.m_Size < sizeof(FrozenType))
    {
      Log(kWarning, "%s: Bad mmap size %d - need at least %d bytes",
          fn, (int) mapping.m_Size, (int) sizeof(FrozenType));
      goto error;
    }

    // Check magic number
    if (data->m_MagicNumber != FrozenType::MagicNumber)
    {
      Log(kDebug, "%s: Bad magic number %08x - current is %08x",
          fn, data->m_MagicNumber, FrozenType::MagicNumber);
      goto error;
    }

    // Move ownership of memory mapping to member variable.
    *result = mapping;

    *ptr = data;

    return true;
  }

  Log(kDebug, "%s: mmap failed", fn);

error:
  MmapFileDestroy(&mapping);
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x18be0
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x18d30
leaq -0x40(%rbp), %rdi
callq 0x14a90
testb $0x1, %al
jne 0xda6c
jmp 0xdb2f
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movl %eax, %r8d
movl $0x8, %edi
leaq 0x16db4(%rip), %rsi     # 0x2484b
movb $0x0, %al
callq 0x7a60
cmpq $0x10, -0x38(%rbp)
jae 0xdaca
movq -0x10(%rbp), %rdx
movq -0x38(%rbp), %rax
movl %eax, %ecx
movl $0x2, %edi
leaq 0x16db9(%rip), %rsi     # 0x24874
movl $0x10, %r8d
movb $0x0, %al
callq 0x7a60
jmp 0xdb46
movq -0x50(%rbp), %rax
cmpl $0x6d99231c, (%rax)     # imm = 0x6D99231C
je 0xdafb
movq -0x10(%rbp), %rdx
movq -0x50(%rbp), %rax
movl (%rax), %ecx
movl $0x8, %edi
leaq 0x16db6(%rip), %rsi     # 0x248a2
movl $0x6d99231c, %r8d       # imm = 0x6D99231C
movb $0x0, %al
callq 0x7a60
jmp 0xdb46
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x50(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xdb53
movq -0x10(%rbp), %rdx
movl $0x8, %edi
leaq 0x16d8f(%rip), %rsi     # 0x248ce
movb $0x0, %al
callq 0x7a60
leaq -0x40(%rbp), %rdi
callq 0x18c40
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverInit(t2::Driver*, t2::DriverOptions const*)
bool DriverInit(Driver* self, const DriverOptions* options)
{
  HeapInit(&self->m_Heap);
  LinearAllocInit(&self->m_Allocator, &self->m_Heap, MB(64), "Driver Linear Allocator");

  LinearAllocSetOwner(&self->m_Allocator, ThreadCurrent());

  MmapFileInit(&self->m_DagFile);
  MmapFileInit(&self->m_StateFile);
  MmapFileInit(&self->m_ScanFile);

  self->m_DagData = nullptr;
  self->m_StateData = nullptr;
  self->m_ScanData = nullptr;

  BufferInit(&self->m_NodeRemap);
  BufferInit(&self->m_Nodes);

  self->m_Options = *options;

  // This linear allocator is only accessed when the state cache is locked.
  LinearAllocInit(&self->m_ScanCacheAllocator, &self->m_Heap, MB(64), "scan cache");
  ScanCacheInit(&self->m_ScanCache, &self->m_Heap, &self->m_ScanCacheAllocator);

  // This linear allocator is only accessed when the state cache is locked.
  LinearAllocInit(&self->m_StatCacheAllocator, &self->m_Heap, MB(64), "stat cache");
  StatCacheInit(&self->m_StatCache, &self->m_StatCacheAllocator, &self->m_Heap);

  memset(&self->m_PassNodeCount, 0, sizeof self->m_PassNodeCount);

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x18920
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rsi
movl $0x4000000, %edx        # imm = 0x4000000
leaq 0x16035(%rip), %rcx     # 0x246b6
callq 0x189e0
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
callq 0x1eb20
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x18b00
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x18be0
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0x18be0
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
callq 0x18be0
movq -0x8(%rbp), %rax
movq $0x0, 0xa0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xa8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0xb0(%rax)
movq -0x8(%rbp), %rdi
addq $0xe8, %rdi
callq 0x147a0
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x147d0
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdi
addq $0xb8, %rdi
movl $0x30, %edx
callq 0x32a0
movq -0x8(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movq -0x8(%rbp), %rsi
movl $0x4000000, %edx        # imm = 0x4000000
leaq 0x15f80(%rip), %rcx     # 0x246ce
callq 0x189e0
movq -0x8(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x118, %rdx            # imm = 0x118
callq 0x19fd0
movq -0x8(%rbp), %rdi
addq $0x1b8, %rdi            # imm = 0x1B8
movq -0x8(%rbp), %rsi
movl $0x4000000, %edx        # imm = 0x4000000
leaq 0x15f4c(%rip), %rcx     # 0x246d9
callq 0x189e0
movq -0x8(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
movq -0x8(%rbp), %rsi
addq $0x1b8, %rsi            # imm = 0x1B8
movq -0x8(%rbp), %rdx
callq 0x1dc30
movq -0x8(%rbp), %rdi
addq $0x340, %rdi            # imm = 0x340
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x31c0
movb $0x1, %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverDestroy(t2::Driver*)
void DriverDestroy(Driver* self)
{
  DigestCacheDestroy(&self->m_DigestCache);

  StatCacheDestroy(&self->m_StatCache);

  ScanCacheDestroy(&self->m_ScanCache);

  BufferDestroy(&self->m_Nodes, &self->m_Heap);
  BufferDestroy(&self->m_NodeRemap, &self->m_Heap);

  MmapFileDestroy(&self->m_ScanFile);
  MmapFileDestroy(&self->m_StateFile);
  MmapFileDestroy(&self->m_DagFile);

  LinearAllocDestroy(&self->m_ScanCacheAllocator);
  LinearAllocDestroy(&self->m_StatCacheAllocator);
  LinearAllocDestroy(&self->m_Allocator);
  HeapDestroy(&self->m_Heap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x268, %rdi            # imm = 0x268
callq 0x1f570
movq -0x8(%rbp), %rdi
addq $0x1f0, %rdi            # imm = 0x1F0
callq 0x1dc80
movq -0x8(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
callq 0x1a050
movq -0x8(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movq -0x8(%rbp), %rsi
callq 0x14800
movq -0x8(%rbp), %rdi
addq $0xe8, %rdi
movq -0x8(%rbp), %rsi
callq 0xbdc0
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
callq 0x18c40
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
callq 0x18c40
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x18c40
movq -0x8(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
callq 0x18ac0
movq -0x8(%rbp), %rdi
addq $0x1b8, %rdi            # imm = 0x1B8
callq 0x18ac0
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x18ac0
movq -0x8(%rbp), %rdi
callq 0x18930
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverSaveScanCache(t2::Driver*)
bool DriverSaveScanCache(Driver* self)
{
  ScanCache* scan_cache = &self->m_ScanCache;

  if (!ScanCacheDirty(scan_cache))
    return true;

  // This will be invalidated.
  self->m_ScanData = nullptr;

  bool success = ScanCacheSave(scan_cache, self->m_DagData->m_ScanCacheFileNameTmp, &self->m_Heap);

  // Unmap the file so we can overwrite it (on Windows.)
  MmapFileDestroy(&self->m_ScanFile);

  if (success)
  {
    success = RenameFile(self->m_DagData->m_ScanCacheFileNameTmp, self->m_DagData->m_ScanCacheFileName);
  }
  else
  {
    remove(self->m_DagData->m_ScanCacheFileNameTmp);
  }

  return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x150, %rax            # imm = 0x150
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x1a710
testb $0x1, %al
jne 0xec60
movb $0x1, -0x1(%rbp)
jmp 0xed19
movq -0x10(%rbp), %rax
movq $0x0, 0xb0(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
addq $0x78, %rdi
callq 0x6e20
movq -0x28(%rbp), %rdi
movq %rax, %rsi
movq -0x10(%rbp), %rdx
callq 0x1a760
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
callq 0x18c40
testb $0x1, -0x19(%rbp)
je 0xecf5
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
addq $0x78, %rdi
callq 0x6e20
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
addq $0x74, %rdi
callq 0x6e20
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x7f20
andb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0xed11
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rdi
addq $0x78, %rdi
callq 0x6e20
movq %rax, %rdi
callq 0x35e0
movb -0x19(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/HashTable.hpp
// Function: void t2::HashSetWalk<0u, t2::DriverRemoveStaleOutputs(t2::Driver*)::$_2>(t2::HashSet<0u>*, t2::DriverRemoveStaleOutputs(t2::Driver*)::$_2)
void HashSetWalk(HashSet<kFlags>* self, Callback callback)
  {
    uint32_t* hashes = self->m_Hashes;
    const char** strings = self->m_Strings;

    uint32_t index = 0;
    for (uint32_t i = 0, count = self->m_TableSize; i < count; ++i)
    {
      if (uint32_t hash = hashes[i])
      {
        callback(index, hash, strings[i]);
        ++index;
      }
    }

    CHECK(index == self->m_RecordCount);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jae 0xffda
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0xffcd
movl -0x24(%rbp), %esi
movl -0x30(%rbp), %edx
movq -0x20(%rbp), %rax
movl -0x28(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
leaq -0x8(%rbp), %rdi
callq 0x138f0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xffcf
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xff8f
jmp 0xffdc
jmp 0xffde
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverCleanOutputs(t2::Driver*)
void DriverCleanOutputs(Driver* self)
{
  ProfilerScope prof_scope("Tundra Clean", 0);
  int count = 0;
  for (NodeState& state : self->m_Nodes)
  {
    for (const FrozenFileAndHash& fh : state.m_MmapData->m_OutputFiles)
    {
      if (0 == RemoveFileOrDir(fh.m_Filename))
        ++count;
    }
  }
  Log(kInfo, "Removed %d output files\n", count);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x14773(%rip), %rsi     # 0x247b9
leaq -0xc(%rbp), %rdi
xorl %edx, %edx
callq 0x67e0
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14a50
movq %rax, -0x68(%rbp)
jmp 0x10075
movq -0x68(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x14a70
movq %rax, -0x70(%rbp)
jmp 0x1008c
movq -0x70(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x38(%rbp), %rax
je 0x10176
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x28, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x6e90
movq %rax, -0x78(%rbp)
jmp 0x100c9
movq -0x78(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x6eb0
movq %rax, -0x80(%rbp)
jmp 0x100e0
movq -0x80(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
je 0x10163
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x6e20
movq %rax, -0x88(%rbp)
jmp 0x1010c
movq -0x88(%rbp), %rdi
callq 0x7ef0
movb %al, -0x89(%rbp)
jmp 0x10120
movb -0x89(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x10153
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x10153
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xc(%rbp), %rdi
callq 0x6980
jmp 0x101a0
jmp 0x10155
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
jmp 0x100e8
jmp 0x10165
movq -0x20(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x20(%rbp)
jmp 0x10094
movl -0x10(%rbp), %edx
leaq 0x14646(%rip), %rsi     # 0x247c6
xorl %eax, %eax
movl $0x4, %edi
callq 0x7a60
jmp 0x1018e
leaq -0xc(%rbp), %rdi
callq 0x6980
addq $0x90, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x35c0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::FindBuildTuple(t2::DagData const*, t2::TargetSpec)
static const BuildTupleData* FindBuildTuple(const DagData* dag, const TargetSpec spec)
{
  for (const BuildTupleData& tuple : dag->m_BuildTuples)
  {
    if (tuple.m_ConfigIndex == spec.m_ConfigIndex &&
        tuple.m_VariantIndex == spec.m_VariantIndex &&
        tuple.m_SubVariantIndex == spec.m_SubVariantIndex)
    {
      return &tuple;
    }
  }

  return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x24(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x24(%rbp), %rax
movq %rax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0xc(%rbp)
movq %rdi, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x3c, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x14420
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x14440
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x10596
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movl (%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x10586
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x10586
movq -0x50(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x10586
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1059e
jmp 0x10588
movq -0x40(%rbp), %rax
addq $0x24, %rax
movq %rax, -0x40(%rbp)
jmp 0x10547
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::FindReachable(unsigned int*, t2::DagData const*, int)
static void FindReachable(uint32_t* node_bits, const DagData* dag, int index)
{
  int word_index = index / 32;
  int bit_index = index & 31;
  if (node_bits[word_index] & (1 << bit_index))
    return;

  node_bits[word_index] |= (1 << bit_index);

  const NodeData* node = dag->m_NodeData + index;

  for (int dep : node->m_Dependencies)
  {
    FindReachable(node_bits, dag, dep);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
andl $0x1f, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl -0x1c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x10bdd
jmp 0x10c68
movl -0x1c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rdi
addq $0xc, %rdi
callq 0x144d0
movslq -0x14(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x6c60
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x6c80
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
je 0x10c68
movq -0x38(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x44(%rbp), %edx
callq 0x10b90
movq -0x38(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
jmp 0x10c37
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SortedArrayUtil.hpp
// Function: void t2::TraverseSortedArraysImpl<t2::DriverSaveBuildState(t2::Driver*)::$_1, t2::DriverSaveBuildState(t2::Driver*)::$_2, t2::DriverSaveBuildState(t2::Driver*)::$_3, t2::DriverSaveBuildState(t2::Driver*)::$_4, t2::HashDigest const*, t2::HashDigest const*>(unsigned long, t2::DriverSaveBuildState(t2::Driver*)::$_3, t2::DriverSaveBuildState(t2::Driver*)::$_1, unsigned long, t2::DriverSaveBuildState(t2::Driver*)::$_4, t2::DriverSaveBuildState(t2::Driver*)::$_2)
void TraverseSortedArraysImpl(
    const size_t      size1,
    ArrayCallback1    callback1,
    KeySelect1        key_select1,
    const size_t      size2,
    ArrayCallback2    callback2,
    KeySelect2        key_select2)
{
  size_t i1 = 0, i2 = 0;

  while (i1 < size1 && i2 < size2)
  {
    const KeyType1 record_1 = key_select1(i1);
    const KeyType2 record_2 = key_select2(i2);

    int compare = CompareArrayKeys(record_1, record_2);

    if (compare <= 0)
    {
      callback1(i1);
      ++i1;

      if (0 == compare)
      {
        ++i2;
      }
    }
    else
    {
      callback2(i2);
      ++i2;
    }
  }

  while (i1 < size1)
  {
    callback1(i1);
    ++i1;
  }

  while (i2 < size2)
  {
    callback2(i2);
    ++i2;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0xa0(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x88(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x20(%rbp), %rcx
xorl %eax, %eax
cmpq -0x10(%rbp), %rcx
movb %al, -0x59(%rbp)
jae 0x130df
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
setb %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x130eb
jmp 0x1316f
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x131d0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x8(%rbp), %rdi
callq 0x13230
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x168f0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jg 0x13151
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x13250
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpl -0x3c(%rbp), %eax
jne 0x1314f
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1316a
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x133a0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x130c2
jmp 0x13171
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x13196
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x13250
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x13171
jmp 0x13198
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x131bd
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x133a0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x13198
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Buffer.hpp
// Function: int t2::BufferPopOne<int>(t2::Buffer<int>*)
T BufferPopOne(Buffer<T>* buffer)
  {
    size_t size = buffer->m_Size;
    CHECK(size > 0);
    buffer->m_Size = size-1;
    return buffer->m_Storage[size - 1];
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x14576
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
movl (%rax,%rcx,4), %eax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SortedArrayUtil.hpp
// Function: t2::HashDigest const* t2::BinarySearch<t2::HashDigest>(t2::HashDigest const*, int, t2::HashDigest const&)
const T* BinarySearch(const T* table, int count, const T& key)
{
  if (count > 0)
  {
    const T* end = table + count;
    const T* iter = std::lower_bound(table, end, key);
    if (iter != end && *iter == key)
    {
      return iter;
    }
  }
  return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x1471a
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x16440
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x14718
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xb910
testb $0x1, %al
jne 0x1470e
jmp 0x14718
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x14722
jmp 0x1471a
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Buffer.hpp
// Function: int* t2::BufferAllocFill<int>(t2::Buffer<int>*, t2::MemAllocHeap*, unsigned long, int)
T* BufferAllocFill(Buffer<T>* buffer, MemAllocHeap* heap, size_t count, T fill_value)
  {
    T *result = BufferAlloc(buffer, heap, count);
    for (size_t i = 0; i < count; ++i)
      result[i] = fill_value;
    return result;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xbe20
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x1478a
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x14764
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemAllocLinear.hpp
// Function: t2::StrDupN(t2::MemAllocLinear*, char const*, unsigned long)
inline char* StrDupN(MemAllocLinear* allocator, const char* str, size_t len)
{
  size_t sz = len + 1;
  char* buffer = static_cast<char*>(LinearAllocate(allocator, sz, 1));
  memcpy(buffer, str, sz - 1);
  buffer[sz - 1] = '\0';
  return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x18b20
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
callq 0x32a0
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/FileInfo.cpp
// Function: t2::ShouldFilter(char const*, unsigned long)
bool ShouldFilter(const char* name, size_t len)
{
  // Filter out some common noise entries that only serve to cause DAG regeneration.

  if (1 == len && name[0] == '.')
    return true;

  if (2 == len && name[0] == '.' && name[1] == '.')
    return true;

  // Vim .foo.swp files
  if (len >= 4 && name[0] == '.' && 0 == memcmp(name + len - 4, ".swp", 4))
    return true;

  // Weed out '.tundra2.*' files too, as the .json file gets removed in between
  // regenerating, messing up glob signatures.
  static const char t2_prefix[] = ".tundra2.";
  if (len >= (sizeof t2_prefix) - 1 && 0 == memcmp(name, t2_prefix, (sizeof t2_prefix) - 1))
    return true;

  // Emacs foo~ files
  if (len > 1 && name[len-1] == '~')
    return true;

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, %eax
cmpq -0x18(%rbp), %rax
jne 0x16aa0
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x16aa0
movb $0x1, -0x1(%rbp)
jmp 0x16b5b
movl $0x2, %eax
cmpq -0x18(%rbp), %rax
jne 0x16acd
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x16acd
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x2e, %eax
jne 0x16acd
movb $0x1, -0x1(%rbp)
jmp 0x16b5b
cmpq $0x4, -0x18(%rbp)
jb 0x16b0b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x16b0b
movq -0x10(%rbp), %rdi
addq -0x18(%rbp), %rdi
addq $-0x4, %rdi
leaq 0xdf9f(%rip), %rsi      # 0x24a92
movl $0x4, %edx
callq 0x3160
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x16b0b
movb $0x1, -0x1(%rbp)
jmp 0x16b5b
cmpq $0x9, -0x18(%rbp)
jb 0x16b35
movq -0x10(%rbp), %rdi
leaq 0xdfb4(%rip), %rsi      # 0x24ad1
movl $0x9, %edx
callq 0x3160
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x16b35
movb $0x1, -0x1(%rbp)
jmp 0x16b5b
cmpq $0x1, -0x18(%rbp)
jbe 0x16b57
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7e, %eax
jne 0x16b57
movb $0x1, -0x1(%rbp)
jmp 0x16b5b
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashUpdate(t2::HashState*, void const*, unsigned long)
void HashUpdate(HashState* self, const void *data_in, size_t size)
{
  const uint8_t*       data   = static_cast<const uint8_t*>(data_in);
  size_t               remain = size;
  uint8_t*             buffer = self->m_Buffer;
  HashStateImpl*       state  = &self->m_StateImpl;
  size_t               used   = self->m_BufUsed;

  while (remain > 0)
  {
    if (used != 0 || remain < sizeof self->m_Buffer)
    {
      const size_t buf_space = (sizeof self->m_Buffer) - used;
      const size_t copy_size = remain < buf_space ? remain : buf_space;
      memcpy(buffer + used, data, copy_size);

      used   += copy_size;
      data   += copy_size;
      remain -= copy_size;

      if (used == sizeof self->m_Buffer)
      {
        HashBlock(buffer, state, self->m_DebugFile);
        used = 0;
      }
    }
    else
    {
      HashBlock(data, state, self->m_DebugFile);
      data   += sizeof self->m_Buffer;
      remain -= sizeof self->m_Buffer;
    }
  }
  
  self->m_BufUsed  = used;
  self->m_MsgSize += size * 8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x28(%rbp)
jbe 0x16e7c
cmpq $0x0, -0x40(%rbp)
jne 0x16db1
cmpq $0x40, -0x28(%rbp)
jae 0x16e47
movl $0x40, %eax
subq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x48(%rbp), %rax
jae 0x16dd2
movq -0x28(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x16dda
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
addq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x32a0
movq -0x50(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpq $0x40, -0x40(%rbp)
jne 0x16e45
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdx
callq 0x20740
movq $0x0, -0x40(%rbp)
jmp 0x16e77
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdx
callq 0x20740
movq -0x20(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
subq $0x40, %rax
movq %rax, -0x28(%rbp)
jmp 0x16d94
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x18(%rbp), %rcx
shlq $0x3, %rcx
movq -0x8(%rbp), %rax
addq 0x40(%rax), %rcx
movq %rcx, 0x40(%rax)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashInit(t2::HashState*)
void HashInit(HashState* self)
{
  self->m_MsgSize = 0;
  self->m_BufUsed = 0;
  self->m_DebugFile = nullptr;
  HashInitImpl(&self->m_StateImpl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x90(%rax)
movq -0x8(%rbp), %rdi
callq 0x20ab0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashFinalize(t2::HashState*, t2::HashDigest*)
void HashFinalize(HashState* self, HashDigest* digest)
{
  uint8_t one_bit = 0x80;
  uint8_t count_data[8];

  // Generate size data in bit endian format
  for (int i = 0; i < 8; ++i)
  {
    count_data[i] = (uint8_t) (self->m_MsgSize >> (56 - i * 8));
  }

  // Set trailing one-bit
  HashUpdate(self, &one_bit, 1);

  // Emit null padding to to make room for 64 bits of size info in the last block 
  static const uint8_t zeroes[128] = { 0 };

  int diff = int(self->m_BufUsed) - (sizeof(self->m_Buffer) - 8);

  if (diff < 0)
    HashUpdate(self, zeroes, -diff);
  else
    HashUpdate(self, zeroes, sizeof(self->m_Buffer) - diff);

  CHECK(self->m_BufUsed == sizeof(self->m_Buffer) - 8);

  // Write size in bits as last 64-bits
  HashUpdate(self, count_data, 8);

  // Make sure we actually finalized our last block
  CHECK(0 == self->m_BufUsed);

  HashFinalizeImpl(&self->m_StateImpl, digest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $-0x80, -0x11(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0x8, -0x20(%rbp)
jge 0x16fc0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x20(%rbp), %edx
shll $0x3, %edx
movl $0x38, %ecx
subl %edx, %ecx
movl %ecx, %ecx
shrq %cl, %rax
movb %al, %cl
movslq -0x20(%rbp), %rax
movb %cl, -0x19(%rbp,%rax)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x16f8b
movq -0x8(%rbp), %rdi
leaq -0x11(%rbp), %rsi
movl $0x1, %edx
callq 0x16d50
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
cltq
subq $0x38, %rax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x17003
movq -0x8(%rbp), %rdi
xorl %eax, %eax
subl -0x24(%rbp), %eax
movslq %eax, %rdx
leaq 0xdae4(%rip), %rsi      # 0x24ae0
callq 0x16d50
jmp 0x1701f
movq -0x8(%rbp), %rdi
movslq -0x24(%rbp), %rax
movl $0x40, %edx
subq %rax, %rdx
leaq 0xdac6(%rip), %rsi      # 0x24ae0
callq 0x16d50
jmp 0x17021
jmp 0x17023
movq -0x8(%rbp), %rdi
leaq -0x19(%rbp), %rsi
movl $0x8, %edx
callq 0x16d50
jmp 0x17037
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x20b70
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashAddStringFoldCase(t2::HashState*, char const*)
void HashAddStringFoldCase(HashState* self, const char* path)
{
  while (true)
  {
    char c = *path++;
    if (c == 0)
      return;
    c = FoldCase(c);
    HashUpdate(self, &c, 1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb (%rax), %al
movb %al, -0x11(%rbp)
movsbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x17083
addq $0x20, %rsp
popq %rbp
retq
movsbl -0x11(%rbp), %edi
callq 0x7f50
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x11(%rbp), %rsi
movl $0x1, %edx
callq 0x16d50
jmp 0x17060
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashAddInteger(t2::HashState*, unsigned long)
void HashAddInteger(HashState* self, uint64_t value)
{
  uint8_t bytes[8];
  bytes[0] = uint8_t(value >> 56);
  bytes[1] = uint8_t(value >> 48);
  bytes[2] = uint8_t(value >> 40);
  bytes[3] = uint8_t(value >> 32);
  bytes[4] = uint8_t(value >> 24);
  bytes[5] = uint8_t(value >> 16);
  bytes[6] = uint8_t(value >>  8);
  bytes[7] = uint8_t(value >>  0);
  HashUpdate(self, bytes, sizeof bytes);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x38, %rax
movb %al, -0x18(%rbp)
movq -0x10(%rbp), %rax
shrq $0x30, %rax
movb %al, -0x17(%rbp)
movq -0x10(%rbp), %rax
shrq $0x28, %rax
movb %al, -0x16(%rbp)
movq -0x10(%rbp), %rax
shrq $0x20, %rax
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
shrq $0x18, %rax
movb %al, -0x14(%rbp)
movq -0x10(%rbp), %rax
shrq $0x10, %rax
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
shrq $0x0, %rax
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x16d50
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::HashInitDebug(t2::HashState*, void*)
void HashInitDebug(HashState* self, void* fh)
{
  self->m_MsgSize = 0;
  self->m_BufUsed = 0;
  self->m_DebugFile = fh;
  HashInitImpl(&self->m_StateImpl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x90(%rax)
movq -0x8(%rbp), %rdi
callq 0x20ab0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Hash.cpp
// Function: t2::DigestToString(char (&) [33], t2::HashDigest const&)
void
DigestToString(char (&buffer)[kDigestStringSize], const HashDigest& digest)
{
  static const char hex[] = "0123456789abcdef";

#if ENABLED(USE_FAST_HASH)
  int i = 0;
  for (int k = 0; k < 2; ++k)
  {
    uint64_t w = digest.m_Words64[k];
    for (int b = 0; b < 8; ++b)
    {
      uint8_t byte = w >> 56;
      buffer[i++] = hex[byte>>4];
      buffer[i++] = hex[byte & 0xf];
      w <<= 8;
    }
  }
#else
  for (size_t i = 0; i < sizeof(digest.m_Data); ++i)
  {
    uint8_t byte = digest.m_Data[i];
    buffer[2 * i + 0] = hex[byte>>4];
    buffer[2 * i + 1] = hex[byte & 0xf];
  }
#endif

  buffer[kDigestStringSize - 1] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jge 0x17275
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x8, -0x24(%rbp)
jge 0x17265
movq -0x20(%rbp), %rax
shrq $0x38, %rax
movb %al, -0x25(%rbp)
movzbl -0x25(%rbp), %eax
sarl $0x4, %eax
movslq %eax, %rcx
leaq 0xd953(%rip), %rax      # 0x24b60
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movzbl -0x25(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0xd92a(%rip), %rax      # 0x24b60
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
shlq $0x8, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x171eb
jmp 0x17267
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x171ca
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonParse(char*, t2::MemAllocLinear*, t2::MemAllocLinear*, char (&) [1024])
const JsonValue* JsonParse(
    char *buffer,
    MemAllocLinear* allocator,
    MemAllocLinear* scratch,
    char (&error_message)[1024])
{
  TimingScope timing_scope(nullptr, &g_Stats.m_JsonParseTimeCycles);

  // Setup statics. Harmless to do multiple times.
  s_TrueValue.m_Type = JsonValue::kBoolean;
  s_TrueValue.m_Boolean = true;
  s_FalseValue.m_Type = JsonValue::kBoolean;
  s_FalseValue.m_Boolean = false;

  JsonState json_state;
  JsonStateInit(&json_state, allocator, scratch, buffer);

  const JsonValue* root = JsonParseValue(&json_state);

  if (root && !JsonLexerExpect(&json_state.m_Lexer, kJsonLexEof))
  {
    root = JsonError(&json_state, "data after document");
  }

  if (root)
  {
    error_message[0] = '\0';
  }
  else
  {
    strncpy(error_message, json_state.m_ErrorMessage, sizeof error_message);
    error_message[sizeof(error_message)-1] = '\0';
  }
  
  return root;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8a0, %rsp            # imm = 0x8A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq 0x182ee(%rip), %rdx     # 0x2f590
addq $0x98, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x7220
movl $0x1, 0x183a0(%rip)     # 0x2f660
movb $0x1, 0x1839d(%rip)     # 0x2f664
movl $0x1, 0x18397(%rip)     # 0x2f668
movb $0x0, 0x18394(%rip)     # 0x2f66c
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq -0x868(%rbp), %rdi
callq 0x17400
jmp 0x172f2
leaq -0x868(%rbp), %rdi
callq 0x17460
movq %rax, -0x888(%rbp)
jmp 0x17307
movq -0x888(%rbp), %rax
movq %rax, -0x880(%rbp)
cmpq $0x0, -0x880(%rbp)
je 0x17391
xorl %eax, %eax
movl %eax, %edx
leaq -0x868(%rbp), %rdi
movl $0xa, %esi
callq 0x175b0
movb %al, -0x889(%rbp)
jmp 0x1733c
movb -0x889(%rbp), %al
testb $0x1, %al
jne 0x17391
jmp 0x17348
leaq 0xdc51(%rip), %rsi      # 0x24fa0
leaq -0x868(%rbp), %rdi
callq 0x17610
movq %rax, -0x898(%rbp)
jmp 0x17364
movq -0x898(%rbp), %rax
movq %rax, -0x880(%rbp)
jmp 0x17391
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x870(%rbp)
movl %eax, -0x874(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7270
jmp 0x173f2
cmpq $0x0, -0x880(%rbp)
je 0x173a4
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
jmp 0x173cb
movq -0x20(%rbp), %rdi
leaq -0x868(%rbp), %rsi
addq $0x420, %rsi            # imm = 0x420
movl $0x400, %edx            # imm = 0x400
callq 0x31b0
movq -0x20(%rbp), %rax
movb $0x0, 0x3ff(%rax)
movq -0x880(%rbp), %rax
movq %rax, -0x8a0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7270
movq -0x8a0(%rbp), %rax
addq $0x8a0, %rsp            # imm = 0x8A0
popq %rbp
retq
movq -0x870(%rbp), %rdi
callq 0x35c0
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonStateInit(t2::JsonState*, t2::MemAllocLinear*, t2::MemAllocLinear*, char*)
static void JsonStateInit(JsonState* state, MemAllocLinear* alloc, MemAllocLinear* scratch, char* buffer)
{
  JsonLexerStateInit(&state->m_Lexer, buffer);
  state->m_ErrorMessage[0] = '\0';
  state->m_Allocator       = alloc;
  state->m_Scratch         = scratch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x17660
movq -0x8(%rbp), %rax
movb $0x0, 0x420(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x820(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x828(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonParseValue(t2::JsonState*)
static const JsonValue* JsonParseValue(JsonState* json_state)
{
  MemAllocLinear  *alloc  = json_state->m_Allocator;
  JsonLexerState  *lexer  = &json_state->m_Lexer;
  JsonLexeme       l      = JsonLexerPeek(lexer);

  const JsonValue *result = nullptr;

  switch (l.m_Type)
  {
    case kJsonLexBeginObject:
      result = JsonParseObject(json_state);
      break;

    case kJsonLexBeginArray:
      result = JsonParseArray(json_state);
      break;

    case kJsonLexString:
    {
      JsonStringValue* sv = LinearAllocate<JsonStringValue>(alloc);
      sv->m_Type   = JsonValue::kString;
      sv->m_String = l.m_String;
      result       = sv;
      JsonLexerSkip(lexer);
      break;
    }

    case kJsonLexNumber:
    {
      JsonNumberValue* nv = LinearAllocate<JsonNumberValue>(alloc);
      nv->m_Type   = JsonValue::kNumber;
      nv->m_Number = l.m_Number;
      result       = nv;
      JsonLexerSkip(lexer);
      break;
    }

    case kJsonLexBoolean:
      result = l.m_Boolean ? &s_TrueValue : &s_FalseValue;
      JsonLexerSkip(lexer);
      break;

    case kJsonLexNull:
      result = &s_NullValue;
      JsonLexerSkip(lexer);
      break;

    default:
      result = JsonError(json_state, "invalid document");
      break;
  }

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x820(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x176a0
movl %eax, -0x28(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x28(%rbp), %eax
movq %rax, -0x48(%rbp)
subq $0x9, %rax
ja 0x17592
movq -0x48(%rbp), %rax
leaq 0xd6c1(%rip), %rcx      # 0x24b78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
callq 0x17700
movq %rax, -0x30(%rbp)
jmp 0x175a6
movq -0x8(%rbp), %rdi
callq 0x17b30
movq %rax, -0x30(%rbp)
jmp 0x175a6
movq -0x10(%rbp), %rdi
callq 0x18830
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl $0x4, (%rax)
movq -0x20(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17dd0
jmp 0x175a6
movq -0x10(%rbp), %rdi
callq 0x18860
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl $0x5, (%rax)
movsd -0x20(%rbp), %xmm0
movq -0x40(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17dd0
jmp 0x175a6
movb -0x20(%rbp), %dl
leaq 0x18109(%rip), %rax     # 0x2f668
leaq 0x180fa(%rip), %rcx     # 0x2f660
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17dd0
jmp 0x175a6
leaq 0xd965(%rip), %rax      # 0x24ee8
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x17dd0
jmp 0x175a6
movq -0x8(%rbp), %rdi
leaq 0xda17(%rip), %rsi      # 0x24fb4
callq 0x17610
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonLexerExpect(t2::JsonLexerState*, t2::JsonLexemeType, t2::JsonLexeme*)
static bool JsonLexerExpect(JsonLexerState* state, JsonLexemeType type, JsonLexeme* out = nullptr)
{
  JsonLexeme l = JsonLexerNext(state);
  if (l.m_Type == type)
  {
    if (out)
      *out = l;
    return true;
  }

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x185b0
movl %eax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x175fb
cmpq $0x0, -0x20(%rbp)
je 0x175f5
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x175ff
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonLexerStateInit(t2::JsonLexerState*, char*)
static void JsonLexerStateInit(JsonLexerState* self, char* buffer)
{
  self->m_Cursor        = buffer;
  self->m_LineNumber    = 1;
  self->m_Lexeme.m_Type = kJsonLexInvalid;
  self->m_Error[0]      = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0xc, 0x10(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonLexerSkip(t2::JsonLexerState*)
static void JsonLexerSkip(JsonLexerState* state)
{
  if (kJsonLexInvalid != state->m_Lexeme.m_Type)
  {
    state->m_Lexeme.m_Type = kJsonLexInvalid;
    return;
  }

  JsonLexerNext(state);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movl $0xc, %eax
cmpl 0x10(%rcx), %eax
je 0x17df7
movq -0x8(%rbp), %rax
movl $0xc, 0x10(%rax)
jmp 0x17e07
movq -0x8(%rbp), %rdi
callq 0x185b0
movl %eax, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::SkipWhitespace(t2::JsonLexerState*)
static char* SkipWhitespace(JsonLexerState* state)
{
  char* ptr = state->m_Cursor;

  while (char ch = *ptr)
  {
    if ('\n' == ch)
    {
      ++state->m_LineNumber;
    }

    if (isspace(ch))
      ++ptr;
    else
      break;
  }

  state->m_Cursor = ptr;
  return ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movb %al, -0x11(%rbp)
cmpb $0x0, -0x11(%rbp)
je 0x18010
movsbl -0x11(%rbp), %ecx
movl $0xa, %eax
cmpl %ecx, %eax
jne 0x17ff0
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movsbl -0x11(%rbp), %edi
callq 0x3070
cmpl $0x0, %eax
je 0x1800c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1800e
jmp 0x18010
jmp 0x17fc7
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::GetNumberLexeme(t2::JsonLexerState*)
static JsonLexeme GetNumberLexeme(JsonLexerState* state)
{
  char *start = state->m_Cursor;
  char *end   = nullptr;

  JsonLexeme result;

  result.m_Type   = kJsonLexNumber;
  result.m_Number = strtod(start, &end);
  state->m_Cursor = end;
  return start != end ? result : JsonLexerError(state, "bad number");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x3280
movsd %xmm0, -0x30(%rbp)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x1808f
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x180a6
movq -0x18(%rbp), %rdi
leaq 0xcf2b(%rip), %rsi      # 0x24fc5
callq 0x18520
movl %eax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)