LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteCommonStringPtr(t2::BinarySegment*, t2::BinarySegment*, char const*, t2::HashTable<t2::CommonStringRecord, 0u>*, t2::MemAllocLinear*)
void WriteCommonStringPtr(BinarySegment* segment, BinarySegment* str_seg, const char* ptr, HashTable<CommonStringRecord, 0>* table, MemAllocLinear* scratch)
{
  uint32_t hash = Djb2Hash(ptr);
  CommonStringRecord* r;
  if (nullptr == (r = HashTableLookup(table, hash, ptr)))
  {
    CommonStringRecord r;
    r.m_Pointer = BinarySegmentPosition(str_seg);
    HashTableInsert(table, hash, ptr, r);
    BinarySegmentWriteStringData(str_seg, ptr);
    BinarySegmentWritePointer(segment, r.m_Pointer);
  }
  else
  {
    BinarySegmentWritePointer(segment, r->m_Pointer);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x58de
movl %eax, %ebp
movq %r12, %rdi
movl %eax, %esi
movq %r14, %rdx
callq 0x7d04
testq %rax, %rax
je 0x5cbe
movl (%rax), %esi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11b5e
movq %r15, %rdi
callq 0x11b99
leaq 0x8(%rsp), %r13
movl %eax, (%r13)
movq %rdx, 0x8(%r13)
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
movq %r13, %rcx
callq 0x7d22
movq %r15, %rdi
movq %r14, %rsi
callq 0x7d4a
movl (%r13), %esi
movq 0x8(%r13), %rdx
movq %rbx, %rdi
callq 0x11b5e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindArrayValue(t2::JsonObjectValue const*, char const*)
static const JsonArrayValue* FindArrayValue(const JsonObjectValue* obj, const char* key)
{
  if (obj == nullptr)
    return nullptr;

  const JsonValue *node = obj->Find(key);

  if (!node)
    return nullptr;
  if (JsonValue::kArray != node->m_Type)
    return nullptr;
  return static_cast<const JsonArrayValue*>(node);
}

// Assembly:
testq %rdi, %rdi
je 0x5f73
pushq %rax
callq 0x7da4
testq %rax, %rax
je 0x5f76
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x3, (%rcx)
cmoveq %rcx, %rax
jmp 0x5f78
xorl %eax, %eax
retq
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GenerateIdeIntegrationFiles(char const*, int, char const**)
bool GenerateIdeIntegrationFiles(const char* build_file, int argc, const char** argv)
{
  MemAllocHeap heap;
  HeapInit(&heap);

  Buffer<char> args;
  BufferInit(&args);
  CreateCommandLine(&heap, &args, argc, argv);

  // Run DAG generator.
  bool result = RunExternalTool("generate-ide-files %s %s", build_file, args.m_Storage);

  BufferDestroy(&args, &heap);
  t2::HeapDestroy(&heap);

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
leaq 0xf(%rsp), %rbx
movq %rbx, %rdi
callq 0xd798
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
movq %rbx, %rdi
movq %r12, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x647e
movq (%r12), %rdx
leaq 0xdb63(%rip), %rdi      # 0x13fb3
movq %r15, %rsi
xorl %eax, %eax
callq 0x620f
movl %eax, %ebp
movq %r12, %rdi
movq %rbx, %rsi
callq 0x7d7f
movq %rbx, %rdi
callq 0xd799
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::CreateCommandLine(t2::MemAllocHeap*, t2::Buffer<char>*, int, char const**)
static void CreateCommandLine(MemAllocHeap* heap, Buffer<char>* args, int argc, const char** argv)
{
  for (int i = 0; i < argc; ++i)
  {
    if (i > 0)
      BufferAppendOne(args, heap, ' ');

    const size_t arglen = strlen(argv[i]);
    const bool has_spaces = nullptr != strchr(argv[i], ' ');

    if (has_spaces)
      BufferAppendOne(args, heap, '"');

    BufferAppend(args, heap, argv[i], arglen);

    if (has_spaces)
      BufferAppendOne(args, heap, '"');
  }

  BufferAppendOne(args, heap, '\0');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rsi, (%rsp)
movq %rdi, 0x8(%rsp)
xorl %r12d, %r12d
testl %edx, %edx
cmovlel %r12d, %edx
movq %rdx, 0x10(%rsp)
pushq $0x20
popq %rbp
movq (%rsp), %r14
cmpq %r12, 0x10(%rsp)
je 0x6558
testq %r12, %r12
je 0x64cd
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %ebp, %edx
callq 0x7f4d
movq (%r15,%r12,8), %rbx
movq %rbx, %rdi
callq 0x3150
movq %rax, %r13
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3130
testq %rax, %rax
je 0x652e
movq %r14, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
pushq $0x22
popq %rdx
callq 0x7f4d
movq (%r15,%r12,8), %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x7f5c
movq %rax, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3290
movq %r14, %rdi
movq %rbx, %rsi
pushq $0x22
popq %rdx
callq 0x7f4d
jmp 0x654d
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x7f5c
movq %rax, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3290
incq %r12
pushq $0x20
popq %rbp
jmp 0x64ad
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7f4d
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GenerateTemplateFiles(int, char const**)
bool GenerateTemplateFiles(int argc, const char** argv)
{
  MemAllocHeap heap;
  HeapInit(&heap);

  Buffer<char> args;
  BufferInit(&args);
  CreateCommandLine(&heap, &args, argc, argv);

  // Run DAG generator.
  bool result = RunExternalTool("create-template-file %s", args.m_Storage);

  BufferDestroy(&args, &heap);
  t2::HeapDestroy(&heap);

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movl %edi, %ebp
leaq 0xf(%rsp), %rbx
movq %rbx, %rdi
callq 0xd798
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x647e
movq (%r15), %rsi
leaq 0xda0f(%rip), %rdi      # 0x13fcc
xorl %eax, %eax
callq 0x620f
movl %eax, %ebp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7d7f
movq %rbx, %rdi
callq 0xd799
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteStringPtr(t2::BinarySegment*, t2::BinarySegment*, char const*)
static void WriteStringPtr(BinarySegment* seg, BinarySegment *str_seg, const char* text)
{
  if (text)
  {
    BinarySegmentWritePointer(seg, BinarySegmentPosition(str_seg));
    BinarySegmentWriteStringData(str_seg, text);
  }
  else
  {
    BinarySegmentWriteNullPointer(seg);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r15
testq %rdx, %rdx
je 0x79d8
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x11b99
movq %r15, %rdi
movl %eax, %esi
callq 0x11b5e
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x7d4a
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x7e29
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteStrHashArray(t2::BinarySegment*, t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*)
static bool WriteStrHashArray(
    BinarySegment* main_seg,
    BinarySegment* aux_seg,
    BinarySegment* str_seg,
    const JsonArrayValue* strings)
{
  BinarySegmentWriteInt32(main_seg, (int) strings->m_Count);
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
  for (size_t i = 0, count = strings->m_Count; i < count; ++i)
  {
    const char* str = strings->m_Values[i]->GetString();
    if (!str)
      return false;
    WriteStringPtr(aux_seg, str_seg, str);
  }
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
  for (size_t i = 0, count = strings->m_Count; i < count; ++i)
  {
    const char* str = strings->m_Values[i]->GetString();
    uint32_t hash = Djb2Hash(str);
    BinarySegmentWriteUint32(aux_seg, hash);
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rcx), %esi
callq 0x7e14
movq %r14, %rdi
callq 0x11b99
movq %r15, %rdi
movl %eax, %esi
callq 0x11b5e
movq 0x8(%rbx), %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x7a66
movq 0x10(%rbx), %rax
movq (%rax,%rbp,8), %rax
cmpl $0x4, (%rax)
je 0x7a4d
xorl %eax, %eax
movq 0x8(%rax), %rdx
testq %rdx, %rdx
je 0x7aab
movq %r14, %rdi
movq %r12, %rsi
callq 0x79a3
incq %rbp
jmp 0x7a39
movq %r14, %rdi
callq 0x11b99
movq %r15, %rdi
movl %eax, %esi
callq 0x11b5e
movq 0x8(%rbx), %r15
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x7aab
movq 0x10(%rbx), %rax
movq (%rax,%r12,8), %rax
cmpl $0x4, (%rax)
je 0x7a93
xorl %eax, %eax
movq 0x8(%rax), %rdi
callq 0x58de
movq %r14, %rdi
movl %eax, %esi
callq 0x7df6
incq %r12
jmp 0x7a7f
cmpq %r13, %rbp
setae %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::FindIntValue(t2::JsonObjectValue const*, char const*, long)
static int64_t FindIntValue(const JsonObjectValue* obj, const char* key, int64_t def_value)
{
  const JsonValue *node = obj->Find(key);
  if (!node)
    return def_value;
  if (JsonValue::kNumber != node->m_Type)
    return def_value;
  return (int64_t) static_cast<const JsonNumberValue*>(node)->m_Number;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
callq 0x7da4
testq %rax, %rax
je 0x7ad9
cmpl $0x5, (%rax)
jne 0x7ad9
cvttsd2si 0x8(%rax), %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteNodeArray(t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*, int const*)
static bool WriteNodeArray(BinarySegment* top_seg, BinarySegment* data_seg, const JsonArrayValue* ints, const int32_t remap_table[])
{
  BinarySegmentWriteInt32(top_seg, (int) ints->m_Count);
  BinarySegmentWritePointer(top_seg, BinarySegmentPosition(data_seg));

  for (size_t i = 0, count = ints->m_Count; i < count; ++i)
  {
    if (const JsonNumberValue* num = ints->m_Values[i]->AsNumber())
    {
      int index = remap_table[(int) num->m_Number];
      BinarySegmentWriteInt32(data_seg, index);
    }
    else
      return false;
  }

  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x8(%rdx), %esi
callq 0x7e14
movq %r15, %rdi
callq 0x11b99
movq %r12, %rdi
movl %eax, %esi
callq 0x11b5e
movq 0x8(%r14), %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x7b3d
movq 0x10(%r14), %rax
movq (%rax,%r13,8), %rax
cmpl $0x5, (%rax)
jne 0x7b3d
cvttsd2si 0x8(%rax), %eax
cltq
movl (%rbx,%rax,4), %esi
movq %r15, %rdi
callq 0x7e14
incq %r13
jmp 0x7b14
cmpq %r12, %r13
setae %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GetBoolean(t2::JsonObjectValue const*, char const*)
static bool GetBoolean(const JsonObjectValue* obj, const char* name)
{
  if (const JsonValue* val = obj->Find(name))
  {
    if (const JsonBooleanValue* b = val->AsBoolean())
    {
      return b->m_Boolean;
    }
  }

  return false;
}

// Assembly:
pushq %rax
callq 0x7da4
testq %rax, %rax
je 0x7b62
cmpl $0x1, (%rax)
jne 0x7b62
movb 0x4(%rax), %al
jmp 0x7b64
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::WriteFileArray(t2::BinarySegment*, t2::BinarySegment*, t2::BinarySegment*, t2::JsonArrayValue const*)
static bool WriteFileArray(
    BinarySegment* seg,
    BinarySegment* ptr_seg,
    BinarySegment* str_seg,
    const JsonArrayValue* files)
{
  if (!files || 0 == files->m_Count)
  {
    BinarySegmentWriteInt32(seg, 0);
    BinarySegmentWriteNullPointer(seg);
    return true;
  }

  BinarySegmentWriteInt32(seg, (int) files->m_Count);
  BinarySegmentWritePointer(seg, BinarySegmentPosition(ptr_seg));

  for (size_t i = 0, count = files->m_Count; i < count; ++i)
  {
    const JsonStringValue *path = files->m_Values[i]->AsString();
    if (!path)
      return false;

    PathBuffer pathbuf;
    PathInit(&pathbuf, path->m_String);

    char cleaned_path[kMaxPathLength];
    PathFormat(cleaned_path, &pathbuf);

    WriteStringPtr(ptr_seg, str_seg, cleaned_path);
    BinarySegmentWriteUint32(ptr_seg, Djb2HashPath(cleaned_path));
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdx, 0x8(%rsp)
movq %rdi, %r12
testq %rcx, %rcx
je 0x7cad
movq %rcx, %rbx
movq %rsi, %r15
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0x7cad
movq %r12, %rdi
callq 0x7e14
movq %r15, %rdi
callq 0x11b99
movq %r12, %rdi
movl %eax, %esi
callq 0x11b5e
movq 0x8(%rbx), %rbp
xorl %r14d, %r14d
leaq 0x21c(%rsp), %r12
leaq 0x10(%rsp), %r13
cmpq %r14, %rbp
je 0x7cd0
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rax
cmpl $0x4, (%rax)
jne 0x7cd0
movq 0x8(%rax), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0xda18
movq %r13, %rdi
movq %r12, %rsi
callq 0xdd8e
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %r13, %rdx
callq 0x79a3
movq %r13, %rdi
callq 0x58de
movq %r15, %rdi
movl %eax, %esi
callq 0x7df6
incq %r14
jmp 0x7c5b
movq %r12, %rdi
xorl %esi, %esi
callq 0x7e14
movq %r12, %rdi
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7e29
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::GetNodeFlag(t2::JsonObjectValue const*, char const*, unsigned int)
static uint32_t GetNodeFlag(const JsonObjectValue* node, const char* name, uint32_t value)
{
  uint32_t result = 0;

  if (const JsonValue* val = node->Find(name))
  {
    if (const JsonBooleanValue* flag = val->AsBoolean())
    {
      if (flag->m_Boolean)
        result = value;
    }
  }

  return result;
}

// Assembly:
pushq %rbx
movl %edx, %ebx
callq 0x7da4
movq %rax, %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x7d02
cmpl $0x1, (%rcx)
jne 0x7d02
xorl %eax, %eax
cmpb $0x0, 0x4(%rcx)
cmovnel %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/JsonParse.hpp
// Function: t2::JsonValue::Find(char const*) const
inline const JsonValue* JsonValue::Find(const char* key) const
{
  const JsonObjectValue* obj = AsObject();
  for (size_t i = 0, count = obj->m_Count; i < count; ++i)
  {
    if (0 == strcmp(obj->m_Names[i], key))
      return obj->m_Values[i];
  }

  return nullptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
cmpl $0x2, (%rdi)
cmovneq %rbx, %r14
movq 0x8(%r14), %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x7de9
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rdi
movq %r15, %rsi
callq 0x3470
testl %eax, %eax
je 0x7de1
incq %r12
jmp 0x7dc3
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/Buffer.hpp
// Function: int* t2::BufferAlloc<int>(t2::Buffer<int>*, t2::MemAllocHeap*, unsigned long)
T* BufferAlloc(Buffer<T>* buffer, MemAllocHeap* heap, size_t count)
  {
    T            *storage  = buffer->m_Storage;
    const size_t  old_size = buffer->m_Size;
    const size_t  capacity = buffer->m_Capacity;

    if (old_size + count > capacity)
    {
      size_t new_capacity = capacity ? capacity *2 : 8;

      if (new_capacity < old_size + count)
        new_capacity = old_size + count;

      storage           = (T*) HeapReallocate(heap, storage, sizeof(T) *new_capacity);
      buffer->m_Storage  = storage;
      buffer->m_Capacity = new_capacity;
    }

    buffer->m_Size = old_size + count;
    return storage + old_size;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq 0x8(%rdi), %r15
movq 0x10(%rdi), %rcx
addq %r15, %rbx
cmpq %rcx, %rbx
jbe 0x7f1b
leaq (%rcx,%rcx), %rdx
testq %rcx, %rcx
pushq $0x8
popq %r12
cmovneq %rdx, %r12
cmpq %rbx, %r12
cmovbeq %rbx, %r12
leaq (,%r12,4), %rdx
movq %rsi, %rdi
movq %rax, %rsi
callq 0xd7aa
movq %rax, (%r14)
movq %r12, 0x10(%r14)
movq %rbx, 0x8(%r14)
leaq (%rax,%r15,4), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/HashTable.hpp
// Function: int t2::HashTableBaseLookup<0u>(t2::HashTableBase<0u>*, unsigned int, char const*)
int HashTableBaseLookup(HashTableBase<kFlags>* self, uint32_t hash, const char* string)
  {
    uint32_t size = self->m_TableSize;

    if (0 == size)
    {
      return -1;
    }

    int (*compare_fn)(const char* l, const char* r);

    if (kFlags & kFlagCaseInsensitive)
    {
      compare_fn = FastCompareNoCase;
    }
    else
    {
      compare_fn = strcmp;
    }

    const uint32_t* hashes = self->m_Hashes;
    const char* const* strings = self->m_Strings;

    uint32_t index = hash & (size - 1);

    for (;;)
    {
      uint32_t candidate_hash = hashes[index];

      if (!candidate_hash)
        return -1;

      if (hash == candidate_hash)
      {
        const char* candidate_string = strings[index];
        if (candidate_string == string || compare_fn(candidate_string, string) == 0)
        {
          return index;
        }
      }

      index = (index + 1) & (size - 1);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x10(%rdi), %ebx
pushq $-0x1
popq %rax
testl %ebx, %ebx
je 0x8019
movq %rdx, %r14
movl %esi, %ebp
movq (%rdi), %r12
movq 0x8(%rdi), %r13
decl %ebx
movl %ebx, %r15d
andl %esi, %r15d
movl %r15d, %eax
movl (%r12,%rax,4), %ecx
testl %ecx, %ecx
je 0x8011
cmpl %ebp, %ecx
jne 0x8009
movq (%r13,%rax,8), %rdi
cmpq %r14, %rdi
je 0x8016
movq %r14, %rsi
callq 0x3470
testl %eax, %eax
je 0x8016
incl %r15d
andl %ebx, %r15d
jmp 0x7fe4
pushq $-0x1
popq %rax
jmp 0x8019
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/HashTable.hpp
// Function: int t2::HashTableBaseInsert<t2::HashTable<t2::CommonStringRecord, 0u>>(t2::HashTable<t2::CommonStringRecord, 0u>*, unsigned int, char const*)
int HashTableBaseInsert(TableType* self, uint32_t hash, const char* string)
  {
    uint32_t record_count = self->m_RecordCount;
    uint32_t table_size = self->m_TableSize;
    uint64_t load = 0x100 * uint64_t(record_count + 1) >> uint64_t(self->m_TableSizeShift);

    if (load > 0x050)
    {
      HashTableGrow(self);
      table_size = self->m_TableSize;
    }

    uint32_t index = hash & (table_size - 1);

    uint32_t* hashes = self->m_Hashes;

    while (hashes[index] != 0)
    {
      index = (index + 1) & (table_size - 1);
    }

    hashes[index] = hash;
    self->m_Strings[index] = string;
    self->m_RecordCount = record_count + 1;

    return index;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl 0x18(%rdi), %r15d
incl %r15d
movq %r15, %rax
shlq $0x8, %rax
movb 0x14(%rdi), %cl
shrq %cl, %rax
cmpq $0x51, %rax
jb 0x8059
movq %r14, %rdi
callq 0x808e
movl 0x10(%r14), %ecx
decl %ecx
movl %ecx, %eax
andl %ebp, %eax
movq (%r14), %rdx
movl %eax, %eax
cmpl $0x0, (%rdx,%rax,4)
je 0x8074
incl %eax
andl %ecx, %eax
jmp 0x8066
movl %ebp, (%rdx,%rax,4)
movq 0x8(%r14), %rcx
movq %rbx, (%rcx,%rax,8)
movl %r15d, 0x18(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/HashTable.hpp
// Function: void t2::HashTableGrow<t2::CommonStringRecord, 0u>(t2::HashTable<t2::CommonStringRecord, 0u>*)
void HashTableGrow(HashTable<T, kFlags>* self)
  {
    MemAllocHeap*  heap      = self->m_Heap;

    const uint32_t old_size  = self->m_TableSize;
    // start at 1<<7 (128), increase by 4x each time
    const uint32_t new_shift = std::max(self->m_TableSizeShift + 2, 7u);
    const uint32_t new_size  = 1 << new_shift;

    uint32_t* old_hashes = self->m_Hashes;
    const char** old_strings = self->m_Strings;
    const T* old_payloads = self->m_Payloads;

    uint32_t* new_hashes = HeapAllocateArrayZeroed<uint32_t>(heap, new_size);
    const char** new_strings = HeapAllocateArrayZeroed<const char*>(heap, new_size);
    T* new_payloads = HeapAllocateArrayZeroed<T>(heap, new_size);

    const uint32_t new_mask = new_size - 1;

    for (uint32_t i = 0; i < old_size; ++i)
    {
      if (uint32_t h = old_hashes[i])
      {
        uint32_t index = h & new_mask;

        while (new_hashes[index] != 0)
        {
          index = (index + 1) & new_mask;
        }

        new_hashes[index] = h;
        new_strings[index] = old_strings[i];
        new_payloads[index] = old_payloads[i];
      }
    }

    HeapFree(heap, old_payloads);
    HeapFree(heap, old_strings);
    HeapFree(heap, old_hashes);

    // Commit
    self->m_Hashes         = new_hashes;
    self->m_Strings        = new_strings;
    self->m_Payloads       = new_payloads;
    self->m_TableSize      = new_size;
    self->m_TableSizeShift = new_shift;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdi), %rbx
movq %rbx, 0x10(%rsp)
movl 0x14(%rdi), %eax
addl $0x2, %eax
cmpl $0x8, %eax
pushq $0x7
popq %rcx
cmovael %eax, %ecx
pushq $0x1
popq %r15
movl %ecx, 0x4(%rsp)
shll %cl, %r15d
movl 0x10(%rdi), %r13d
movq (%rdi), %r12
movq 0x8(%rdi), %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0x20(%rsp)
movq 0x28(%rdi), %r14
movq %rbx, %rdi
movq %r15, %rsi
callq 0x81b3
movq %rax, %rbp
movq %rbx, %rdi
movq %r15, %rsi
movq %r15, %rbx
movq %r15, 0x8(%rsp)
callq 0x81d2
movq %rax, %r15
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x81f1
movq %rax, %rbx
movq 0x8(%rsp), %rax
decl %eax
xorl %ecx, %ecx
cmpq %r13, %rcx
je 0x815d
movl (%r12,%rcx,4), %edx
testl %edx, %edx
je 0x8158
movl %edx, %edi
movl %edi, %esi
andl %eax, %esi
movl %esi, %edi
incl %edi
cmpl $0x0, (%rbp,%rsi,4)
jne 0x8124
movl %edx, (%rbp,%rsi,4)
movq 0x18(%rsp), %rdx
movq (%rdx,%rcx,8), %rdx
movq %rdx, (%r15,%rsi,8)
movq %rcx, %rdx
shlq $0x4, %rdx
shlq $0x4, %rsi
movups (%r14,%rdx), %xmm0
movups %xmm0, (%rbx,%rsi)
incq %rcx
jmp 0x8115
movq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0xd7a2
movq %r13, %rdi
movq 0x18(%rsp), %rsi
callq 0xd7a2
movq %r13, %rdi
movq %r12, %rsi
callq 0xd7a2
movq 0x20(%rsp), %rax
movq %rbp, (%rax)
movq %r15, 0x8(%rax)
movq %rbx, 0x28(%rax)
movq 0x8(%rsp), %rcx
movl %ecx, 0x10(%rax)
movl 0x4(%rsp), %ecx
movl %ecx, 0x14(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
callq 0xd798
leaq 0x8(%rbx), %r15
leaq 0xb023(%rip), %rcx      # 0x14630
movl $0x4000000, %edx        # imm = 0x4000000
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd7ec
callq 0x10914
movq %r15, %rdi
movq %rax, %rsi
callq 0xd860
leaq 0x40(%rbx), %rdi
callq 0xd8a4
leaq 0x60(%rbx), %rdi
callq 0xd8a4
leaq 0x80(%rbx), %rdi
callq 0xd8a4
andq $0x0, 0xb0(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0xa0(%rbx)
movups %xmm0, 0xe8(%rbx)
movups %xmm0, 0xf8(%rbx)
movups %xmm0, 0x108(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm0, 0xb8(%rbx)
movups %xmm1, 0xc8(%rbx)
movups %xmm2, 0xd8(%rbx)
leaq 0x118(%rbx), %r14
leaq 0xafa5(%rip), %rcx      # 0x14648
movl $0x4000000, %edx        # imm = 0x4000000
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd7ec
leaq 0x150(%rbx), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xe454
leaq 0x1b8(%rbx), %r14
leaq 0xaf80(%rip), %rcx      # 0x14653
movl $0x4000000, %edx        # imm = 0x4000000
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd7ec
leaq 0x1f0(%rbx), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10148
addq $0x340, %rbx            # imm = 0x340
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x31b0
movb $0x1, %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
movq %rdi, %rbx
addq $0x268, %rdi            # imm = 0x268
callq 0x10f6d
leaq 0x1f0(%rbx), %rdi
callq 0x1016c
leaq 0x150(%rbx), %rdi
callq 0xe478
leaq 0x100(%rbx), %rdi
movq %rbx, %rsi
callq 0xc1cf
leaq 0xe8(%rbx), %rdi
movq %rbx, %rsi
callq 0x7ea6
leaq 0x80(%rbx), %rdi
callq 0xd8af
leaq 0x60(%rbx), %rdi
callq 0xd8af
leaq 0x40(%rbx), %rdi
callq 0xd8af
leaq 0x118(%rbx), %rdi
callq 0xd84a
leaq 0x1b8(%rbx), %rdi
callq 0xd84a
leaq 0x8(%rbx), %rdi
callq 0xd84a
movq %rbx, %rdi
popq %rbx
jmp 0xd799
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x150(%rdi), %r14
movq %r14, %rdi
callq 0xe874
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x9ad6
andq $0x0, 0xb0(%rbx)
movq 0xa0(%rbx), %rax
movslq 0x78(%rax), %rcx
testq %rcx, %rcx
leaq 0x78(%rcx,%rax), %rsi
cmoveq %rcx, %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0xe8a0
movl %eax, %ebp
leaq 0x80(%rbx), %rdi
callq 0xd8af
movq 0xa0(%rbx), %rax
movslq 0x78(%rax), %rcx
testq %rcx, %rcx
leaq 0x78(%rcx,%rax), %rdi
cmoveq %rcx, %rdi
testb %bpl, %bpl
je 0x9acf
movslq 0x74(%rax), %rcx
testq %rcx, %rcx
leaq 0x74(%rcx,%rax), %rsi
cmoveq %rcx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x5c5d
callq 0x3600
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
andl $0x0, 0x4(%rsp)
leaq 0xa2b5(%rip), %rdi      # 0x14733
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x551c
movq 0x100(%r14), %r15
movq 0x108(%r14), %r14
shlq $0x6, %r14
addq %r15, %r14
cmpq %r14, %r15
je 0xa4ee
movq 0x8(%r15), %rax
movslq 0x2c(%rax), %rcx
testq %rcx, %rcx
leaq 0x2c(%rcx,%rax), %r12
cmoveq %rcx, %r12
movslq 0x28(%rax), %r13
shlq $0x3, %r13
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0xa4e8
leaq (%r12,%rbp), %rdi
movslq (%r12,%rbp), %rax
addq %rax, %rdi
testq %rax, %rax
cmoveq %rax, %rdi
callq 0x5c50
xorb $0x1, %al
movzbl %al, %eax
addl %eax, %ebx
addq $0x8, %rbp
jmp 0xa4bf
addq $0x40, %r15
jmp 0xa49c
leaq 0xa24b(%rip), %rsi      # 0x14740
pushq $0x4
popq %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x5981
leaq 0x4(%rsp), %rdi
callq 0x5488
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa51c
movq %rax, %rbx
leaq 0x4(%rsp), %rdi
callq 0x5488
movq %rbx, %rdi
callq 0x35e0
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/Driver.cpp
// Function: bool t2::LoadFrozenData<t2::DagData>(char const*, t2::MemoryMappedFile*, t2::DagData 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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xd8a4
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd94b
movq (%r12), %r12
testq %r12, %r12
je 0xa5a5
movl 0x10(%rsp), %r8d
leaq 0xa253(%rip), %rsi      # 0x147c5
pushq $0x8
popq %rdi
movq %rbx, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x5981
movq 0x10(%rsp), %rcx
cmpq $0x83, %rcx
ja 0xa5bb
leaq 0xa257(%rip), %rsi      # 0x147ee
pushq $0x2
popq %rdi
movq %rbx, %rdx
movl $0x84, %r8d
jmp 0xa5f4
leaq 0xa29c(%rip), %rsi      # 0x14848
pushq $0x8
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x5981
jmp 0xa5fb
movl (%r12), %ecx
cmpl $0x6d992313, %ecx       # imm = 0x6D992313
jne 0xa5e1
movups 0x8(%rsp), %xmm0
movups 0x18(%rsp), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %r12, (%r14)
movb $0x1, %al
jmp 0xa607
leaq 0xa234(%rip), %rsi      # 0x1481c
pushq $0x8
popq %rdi
movq %rbx, %rdx
movl $0x6d992313, %r8d       # imm = 0x6D992313
xorl %eax, %eax
callq 0x5981
leaq 0x8(%rsp), %rdi
callq 0xd8af
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ecx
movq %rsi, %rbx
pushq $0x20
popq %rsi
movl %edx, %eax
cltd
idivl %esi
cltq
movl (%rdi,%rax,4), %edx
pushq $0x1
popq %rsi
shll %cl, %esi
btl %ecx, %edx
jae 0xaa3f
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rdi, %r14
orl %esi, %edx
movl %edx, (%rdi,%rax,4)
movslq 0xc(%rbx), %rax
testq %rax, %rax
leaq 0xc(%rax,%rbx), %rdx
cmoveq %rax, %rdx
movslq %ecx, %rax
imulq $0x48, %rax, %rax
leaq (%rdx,%rax), %rcx
movslq 0x14(%rdx,%rax), %rsi
testq %rsi, %rsi
leaq 0x14(%rsi,%rcx), %r15
cmoveq %rsi, %r15
movslq 0x10(%rdx,%rax), %r12
shlq $0x2, %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0xaa35
movl (%r15,%r13), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0xaa10
addq $0x4, %r13
jmp 0xaa7f
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
testl %esi, %esi
jle 0xc19e
movq %rdx, %rbx
movl %esi, %r15d
shlq $0x4, %r15
addq %rdi, %r15
movq %r15, %rsi
callq 0xc8eb
cmpq %r15, %rax
je 0xc19e
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x7d72
testb %al, %al
jne 0xc1a1
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
callq 0x7eca
xorl %ecx, %ecx
cmpq %rcx, %r14
je 0xc1c7
movl %ebx, (%rax,%rcx,4)
incq %rcx
jmp 0xc1ba
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/HashTable.hpp
// Function: void t2::HashTableGrow<0u>(t2::HashSet<0u>*)
void HashTableGrow(HashSet<kFlags>* self)
  {
    MemAllocHeap*  heap      = self->m_Heap;

    const uint32_t old_size  = self->m_TableSize;
    // start at 1<<7 (128), increase by 4x each time
    const uint32_t new_shift = std::max(self->m_TableSizeShift + 2, 7u);
    const uint32_t new_size  = 1 << new_shift;

    uint32_t* old_hashes = self->m_Hashes;
    const char** old_strings = self->m_Strings;

    uint32_t* new_hashes = HeapAllocateArrayZeroed<uint32_t>(heap, new_size);
    const char** new_strings = HeapAllocateArrayZeroed<const char*>(heap, new_size);

    const uint32_t new_mask = new_size - 1;

    for (uint32_t i = 0; i < old_size; ++i)
    {
      if (uint32_t h = old_hashes[i])
      {
        uint32_t index = h & new_mask;

        while (new_hashes[index] != 0)
        {
          index = (index + 1) & new_mask;
        }

        new_hashes[index] = h;
        new_strings[index] = old_strings[i];
      }
    }

    HeapFree(heap, old_strings);
    HeapFree(heap, old_hashes);

    // Commit
    self->m_Hashes         = new_hashes;
    self->m_Strings        = new_strings;
    self->m_TableSize      = new_size;
    self->m_TableSizeShift = new_shift;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl 0x14(%rdi), %eax
addl $0x2, %eax
cmpl $0x8, %eax
pushq $0x7
popq %rcx
cmovael %eax, %ecx
pushq $0x1
popq %rbx
movl %ecx, 0xc(%rsp)
shll %cl, %ebx
movq 0x20(%rdi), %r15
movl 0x10(%rdi), %r14d
movq (%rdi), %r12
movq %rdi, 0x18(%rsp)
movq 0x8(%rdi), %rbp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x81b3
movq %rax, %r13
movq %r15, 0x10(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x81d2
movq %rax, %r15
movq %rbx, 0x20(%rsp)
leal -0x1(%rbx), %eax
xorl %ecx, %ecx
cmpq %r14, %rcx
je 0xc7df
movl (%r12,%rcx,4), %edx
testl %edx, %edx
je 0xc7da
movl %edx, %edi
movl %edi, %esi
andl %eax, %esi
movl %esi, %edi
incl %edi
cmpl $0x0, (%r13,%rsi,4)
jne 0xc7bc
movl %edx, (%r13,%rsi,4)
movq (%rbp,%rcx,8), %rdx
movq %rdx, (%r15,%rsi,8)
incq %rcx
jmp 0xc7ad
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xd7a2
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd7a2
movq 0x18(%rsp), %rcx
movq %r13, (%rcx)
movq %r15, 0x8(%rcx)
movq 0x20(%rsp), %rax
movl %eax, 0x10(%rcx)
movl 0xc(%rsp), %eax
movl %eax, 0x14(%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1(%rdx), %rsi
pushq $0x1
popq %rdx
callq 0xd865
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3290
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x2, %rsi
je 0xca23
cmpq $0x1, %r14
jne 0xca32
movb $0x1, %al
cmpb $0x2e, (%rbx)
jne 0xca78
jmp 0xca7a
cmpb $0x2e, (%rbx)
jne 0xca6e
movb $0x1, %al
cmpb $0x2e, 0x1(%rbx)
jne 0xca6e
jmp 0xca7a
cmpq $0x4, %r14
jb 0xca68
cmpb $0x2e, (%rbx)
jne 0xca48
cmpl $0x7077732e, -0x4(%rbx,%r14) # imm = 0x7077732E
je 0xca64
cmpq $0x9, %r14
jb 0xca6e
leaq 0x8051(%rip), %rsi      # 0x14aa6
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x3360
testl %eax, %eax
jne 0xca6e
movb $0x1, %al
jmp 0xca7a
cmpq $0x2, %r14
jb 0xca78
movb $0x1, %al
cmpb $0x7e, -0x1(%rbx,%r14)
je 0xca7a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x50(%rdi), %r12
movq 0x48(%rdi), %rbp
movq %rdx, (%rsp)
testq %rbx, %rbx
je 0xcc96
testq %rbp, %rbp
sete %al
cmpq $0x40, %rbx
setae %cl
testb %cl, %al
jne 0xcc78
pushq $0x40
popq %r13
subq %rbp, %r13
cmpq %r13, %rbx
cmovbq %rbx, %r13
leaq (%r12,%rbp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3290
addq %r13, %rbp
addq %r13, %r15
subq %r13, %rbx
cmpq $0x40, %rbp
jne 0xcc20
movq 0x90(%r14), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x1188c
xorl %ebp, %ebp
jmp 0xcc20
movq 0x90(%r14), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1188c
addq $0x40, %r15
addq $-0x40, %rbx
xorl %ebp, %ebp
jmp 0xcc20
movq %rbp, 0x48(%r14)
movq (%rsp), %rax
shlq $0x3, %rax
addq %rax, 0x40(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movb $-0x80, 0xf(%rsp)
movq 0x40(%rdi), %rax
pushq $0x38
popq %rcx
leaq 0x10(%rsp), %rdx
cmpq $-0x8, %rcx
je 0xcd4a
movq %rax, %rsi
shrq %cl, %rsi
movb %sil, (%rdx)
addq $-0x8, %rcx
incq %rdx
jmp 0xcd32
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0xcc00
movl 0x48(%r14), %eax
pushq $0x38
popq %rdx
subl %eax, %edx
addl $-0x38, %eax
pushq $0x40
popq %rcx
subq %rax, %rcx
testl %eax, %eax
cmovnsq %rcx, %rdx
leaq 0x7d37(%rip), %rsi      # 0x14ab0
movq %r14, %rdi
callq 0xcc00
leaq 0x10(%rsp), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0xcc00
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11a52
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7(%rsp), %r15
pushq $0x1
popq %r12
movsbl (%rbx), %eax
testl %eax, %eax
je 0xcde8
incq %rbx
leal -0x41(%rax), %ecx
leal 0x20(%rax), %edx
cmpl $0x1a, %ecx
movzbl %dl, %ecx
cmovael %eax, %ecx
movb %cl, 0x7(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xcc00
jmp 0xcdbb
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
xorl %eax, %eax
movl $0x8, %ecx
leaq 0x7cf0(%rip), %rdx      # 0x14b30
xorl %r8d, %r8d
cmpq $0x2, %rax
je 0xce8a
movq (%rsi,%rax,8), %r9
movslq %r8d, %r8
movl %ecx, %r10d
subl $0x1, %r10d
jb 0xce85
movq %r9, %r11
shrq $0x38, %r11
movq %r9, %rbx
shrq $0x3c, %rbx
movb (%rbx,%rdx), %bl
movb %bl, (%rdi,%r8)
andl $0xf, %r11d
movb (%r11,%rdx), %r11b
movb %r11b, 0x1(%rdi,%r8)
addq $0x2, %r8
shlq $0x8, %r9
jmp 0xce53
incq %rax
jmp 0xce43
movb $0x0, 0x20(%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x848, %rsp            # imm = 0x848
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
andq $0x0, (%rsp)
movl $0x98, %eax
addq 0x10105(%rip), %rax     # 0x1cfc0
movq %rax, 0x8(%rsp)
callq 0x5b35
movq %rax, 0x10(%rsp)
pushq $0x1
popq %rax
movl %eax, 0x1079d(%rip)     # 0x1d670
movb $0x1, 0x1079a(%rip)     # 0x1d674
movl %eax, 0x10798(%rip)     # 0x1d678
xorl %ecx, %ecx
movb %cl, 0x10794(%rip)      # 0x1d67c
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
movl %eax, 0x8(%rdi)
movl $0xc, 0x10(%rdi)
movb %cl, 0x20(%rdi)
movb %cl, 0x420(%rdi)
movq %r15, 0x820(%rdi)
movq %r14, 0x828(%rdi)
callq 0xcf8d
movq %rax, %r14
testq %rax, %rax
je 0xcf3e
leaq 0x18(%rsp), %rdi
callq 0xd72b
cmpl $0xa, %eax
je 0xcf5d
leaq 0x7cc0(%rip), %rsi      # 0x14bf4
leaq 0x18(%rsp), %rdi
callq 0xd365
leaq 0x438(%rsp), %rsi
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
callq 0x31a0
addq $0x3ff, %rbx            # imm = 0x3FF
xorl %r14d, %r14d
movb $0x0, (%rbx)
movq %rsp, %rdi
callq 0x55d6
movq %r14, %rax
addq $0x848, %rsp            # imm = 0x848
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x55d6
movq %rbx, %rdi
callq 0x35e0
// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonLexerNext(t2::JsonLexerState*)
static JsonLexeme JsonLexerNext(JsonLexerState* state)
{
  if (kJsonLexInvalid != state->m_Lexeme.m_Type)
  {
    JsonLexeme result = state->m_Lexeme;
    state->m_Lexeme.m_Type = kJsonLexInvalid;
    return result;
  }

  return JsonLexerFetchNext(state);
}

// Assembly:
movl 0x10(%rdi), %eax
cmpl $0xc, %eax
jne 0xd73e
pushq %rax
callq 0xd3ba
addq $0x8, %rsp
retq
movq 0x18(%rdi), %rdx
movl $0xc, 0x10(%rdi)
retq