LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::GetLiteralLexeme(t2::JsonLexerState*)
static JsonLexeme GetLiteralLexeme(JsonLexerState* state)
{
  char *rptr = state->m_Cursor;
  char *eptr = rptr;
  while (isalnum(*eptr))
  {
    eptr++;
  }

  size_t kwlen = (eptr - rptr);

  if (4 == kwlen)
  {
    if (0 == strncmp("true", rptr, 4))
    {
      state->m_Cursor = eptr;
      return s_TrueLexeme;
    }

    else if (0 == strncmp("null", rptr, 4))
    {
      state->m_Cursor = eptr;
      return s_NullLexeme;
    }
  }

  else if (5 == kwlen)
  {
    if (0 == strncmp("false", rptr, 5))
    {
      state->m_Cursor = eptr;
      return s_FalseLexeme;
    }
  }

  return JsonLexerError(state, "invalid literal, expected one of false, true or null");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %edi
callq 0x3360
cmpl $0x0, %eax
je 0x183fe
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x183df
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movl $0x4, %eax
cmpq -0x30(%rbp), %rax
jne 0x184a3
movq -0x20(%rbp), %rsi
leaq 0xcc36(%rip), %rdi      # 0x2505d
movl $0x4, %edx
callq 0x3180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1845f
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq 0xcb25(%rip), %rax      # 0x24f70
movq %rax, -0x10(%rbp)
movq 0xcb22(%rip), %rax      # 0x24f78
movq %rax, -0x8(%rbp)
jmp 0x18509
movq -0x20(%rbp), %rsi
leaq 0xcc2e(%rip), %rdi      # 0x25098
movl $0x4, %edx
callq 0x3180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1849f
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq 0xcaf2(%rip), %rax      # 0x24f80
movq %rax, -0x10(%rbp)
movq 0xcaef(%rip), %rax      # 0x24f88
movq %rax, -0x8(%rbp)
jmp 0x18509
jmp 0x184a1
jmp 0x184f2
movl $0x5, %eax
cmpq -0x30(%rbp), %rax
jne 0x184f0
movq -0x20(%rbp), %rsi
leaq 0xcba9(%rip), %rdi      # 0x25062
movl $0x5, %edx
callq 0x3180
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x184ee
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq 0xcab3(%rip), %rax      # 0x24f90
movq %rax, -0x10(%rbp)
movq 0xcab0(%rip), %rax      # 0x24f98
movq %rax, -0x8(%rbp)
jmp 0x18509
jmp 0x184f0
jmp 0x184f2
movq -0x18(%rbp), %rdi
leaq 0xcb6b(%rip), %rsi      # 0x25068
callq 0x18520
movl %eax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonParseObject(t2::JsonState*)::KvPairList::Init(t2::MemAllocLinear*)
void Init(MemAllocLinear* scratch)
    {
      m_Scratch = scratch;
      m_Head    = nullptr;
      m_Tail    = nullptr;
      m_Count   = 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rcx
movl $0xc, %eax
cmpl 0x10(%rcx), %eax
je 0x185eb
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movl $0xc, 0x10(%rax)
jmp 0x185fb
movq -0x18(%rbp), %rdi
callq 0x17e10
movl %eax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonParseObject(t2::JsonState*)::KvPairList::Add(char const*, t2::JsonValue const*)
void Add(const char* key, const JsonValue* value)
    {
      if (1 == ++m_Count)
      {
        m_Head = m_Tail = LinearAllocate<KvPair>(m_Scratch);
        m_Head->m_Key   = key;
        m_Head->m_Value = value;
        m_Head->m_Next  = nullptr;
      }
      else
      {
        KvPair* tail = m_Tail;
        m_Tail          = LinearAllocate<KvPair>(m_Scratch);
        m_Tail->m_Key   = key;
        m_Tail->m_Value = value;
        m_Tail->m_Next  = nullptr;
        tail->m_Next    = m_Tail;
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl $0x1, %eax
cmpq %rcx, %rax
jne 0x18682
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x186e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, (%rcx)
movq -0x18(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, 0x8(%rcx)
movq 0x8(%rax), %rax
movq $0x0, 0x10(%rax)
jmp 0x186d0
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq (%rax), %rdi
callq 0x186e0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdx
movq 0x10(%rax), %rcx
movq %rdx, (%rcx)
movq -0x18(%rbp), %rdx
movq 0x10(%rax), %rcx
movq %rdx, 0x8(%rcx)
movq 0x10(%rax), %rcx
movq $0x0, 0x10(%rcx)
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/JsonParse.cpp
// Function: t2::JsonParseArray(t2::JsonState*)::ValueList::Add(t2::JsonValue const*)
void Add(const JsonValue* value)
    {
      if (1 == ++m_Count)
      {
        m_Head = m_Tail = LinearAllocate<ListElem>(m_Scratch);
        m_Head->m_Value = value;
        m_Head->m_Next  = nullptr;
      }
      else
      {
        ListElem* tail = m_Tail;
        m_Tail          = LinearAllocate<ListElem>(m_Scratch);
        m_Tail->m_Value = value;
        m_Tail->m_Next  = nullptr;
        tail->m_Next    = m_Tail;
      }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
movl $0x1, %eax
cmpq %rcx, %rax
jne 0x187b2
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x18800
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, (%rcx)
movq 0x8(%rax), %rax
movq $0x0, 0x8(%rax)
jmp 0x187f4
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq (%rax), %rdi
callq 0x18800
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rdx
movq 0x10(%rax), %rcx
movq %rdx, (%rcx)
movq 0x10(%rax), %rcx
movq $0x0, 0x8(%rcx)
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemAllocHeap.cpp
// Function: t2::HeapReallocate(t2::MemAllocHeap*, void*, unsigned long)
void* HeapReallocate(MemAllocHeap *heap, void *ptr, size_t size)
{
  void* new_ptr = realloc(ptr, size);

  if (!new_ptr && size > 0)
  {
    Croak("out of memory reallocating %d bytes at %p", (int) size, ptr);
  }

  return new_ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x3590
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x189cb
cmpq $0x0, -0x18(%rbp)
jbe 0x189cb
movq -0x18(%rbp), %rax
movl %eax, %esi
movq -0x10(%rbp), %rdx
leaq 0xc757(%rip), %rdi      # 0x2511b
movb $0x0, %al
callq 0x75a0
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemAllocLinear.cpp
// Function: t2::LinearAllocInit(t2::MemAllocLinear*, t2::MemAllocHeap*, unsigned long, char const*)
void LinearAllocInit(MemAllocLinear* self, MemAllocHeap* heap, size_t max_size, const char* debug_name)
{
  size_t alloc_size = max_size + MemAllocLinear::kMaxAlignment - 1;
  self->m_BasePointer = static_cast<char*>(HeapAllocate(heap, alloc_size));
  self->m_Pointer     = nullptr;
  self->m_Size        = max_size;
  self->m_Offset      = 0;
  self->m_BackingHeap = heap;
  self->m_DebugName   = debug_name;

  uintptr_t aligned_base = uintptr_t(self->m_BasePointer + MemAllocLinear::kMaxAlignment - 1) & ~(MemAllocLinear::kMaxAlignment - 1);
  uintptr_t delta        = aligned_base - uintptr_t(self->m_BasePointer);

  self->m_Pointer = self->m_BasePointer + delta;
  self->m_Size   -= (delta);

  self->m_OwnerThread = 0;

#if ENABLED(USE_VALGRIND)
  VALGRIND_MAKE_MEM_NOACCESS(self->m_BasePointer, alloc_size);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x40, %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x18940
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
addq $0x40, %rax
addq $-0x1, %rax
andq $-0x40, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemAllocLinear.cpp
// Function: t2::LinearAllocate(t2::MemAllocLinear*, unsigned long, unsigned long)
void* LinearAllocate(MemAllocLinear* self, size_t size, size_t align)
{
  CHECK_THREAD_OWNERSHIP(self);

  // Alignment must be power of two
  CHECK(0 == (align & (align - 1)));

  // Alignment must be non-zero
  CHECK(align > 0);

  // Compute aligned offset.
  size_t offset = (self->m_Offset + align - 1) & ~(align - 1);

	CHECK(0 == (offset & (align -1)));

  // See if we have space.
  if (offset + size <= self->m_Size)
  {
    char* ptr = self->m_Pointer + offset;
    self->m_Offset = offset + size;

#if ENABLED(USE_VALGRIND)
    VALGRIND_MAKE_MEM_UNDEFINED(ptr, size);
#endif
    return ptr;
  }
  else
  {
    Croak("Out of memory in linear allocator: %s", self->m_DebugName);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
jmp 0x18b36
jmp 0x18b38
jmp 0x18b3a
jmp 0x18b3c
jmp 0x18b3e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq -0x18(%rbp), %rax
subq $0x1, %rax
movq -0x18(%rbp), %rcx
subq $0x1, %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x18b63
movq -0x20(%rbp), %rax
addq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
ja 0x18b9f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rcx
addq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
leaq 0xc597(%rip), %rdi      # 0x25145
movb $0x0, %al
callq 0x75a0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemoryMappedFile.cpp
// Function: t2::MmapFileUnmap(t2::MemoryMappedFile*)
void MmapFileUnmap(MemoryMappedFile* self)
{
  if (self->m_Address)
  {
    TimingScope timing_scope(&g_Stats.m_MunmapCalls, &g_Stats.m_MunmapTimeCycles);

    if (0 != munmap(self->m_Address, self->m_Size))
      Croak("munmap(%p, %d) failed: %d", self->m_Address, (int) self->m_Size, errno);

    close((int) self->m_SysData[0]);
  }

  Clear(self);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x18d0e
leaq -0x20(%rbp), %rdi
leaq 0x1690b(%rip), %rdx     # 0x2f590
movq %rdx, %rsi
addq $0x40, %rsi
addq $0x48, %rdx
callq 0x7220
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x31e0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x18cf7
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x38(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x30(%rbp)
callq 0x3050
movq -0x38(%rbp), %rsi
movl -0x30(%rbp), %edx
movl (%rax), %ecx
leaq 0xc494(%rip), %rdi      # 0x2516b
xorl %eax, %eax
callq 0x75a0
jmp 0x18ce0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x7270
jmp 0x18d1d
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x3640
jmp 0x18d05
leaq -0x20(%rbp), %rdi
callq 0x7270
movq -0x8(%rbp), %rdi
callq 0x18c00
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x35c0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/MemoryMappedFile.cpp
// Function: t2::MmapFileMap(t2::MemoryMappedFile*, char const*)
void MmapFileMap(MemoryMappedFile* self, const char *fn)
{
  TimingScope timing_scope(&g_Stats.m_MmapCalls, &g_Stats.m_MmapTimeCycles);

  MmapFileUnmap(self);

  int fd = open(fn, O_RDONLY);

  if (-1 == fd)
    goto error;

  struct stat stbuf;
  if (0 != fstat(fd, &stbuf))
    goto error;

  self->m_Address    = mmap(NULL, stbuf.st_size, PROT_READ, MAP_FILE|MAP_PRIVATE, fd, 0);
  self->m_Size       = stbuf.st_size;
  self->m_SysData[0] = fd;

  if (self->m_Address)
    return;

error:
  if (-1 != fd)
    close(fd);

  Clear(self);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x16846(%rip), %rdx     # 0x2f590
movq %rdx, %rsi
addq $0x30, %rsi
addq $0x38, %rdx
leaq -0x28(%rbp), %rdi
callq 0x7220
movq -0x8(%rbp), %rdi
callq 0x18c60
jmp 0x18d69
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb %sil, %al
callq 0x3250
movl %eax, -0xd0(%rbp)
jmp 0x18d7f
movl -0xd0(%rbp), %eax
movl %eax, -0x38(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x38(%rbp), %eax
jne 0x18db1
jmp 0x18e29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7270
jmp 0x18e66
movl -0x38(%rbp), %edi
leaq -0xc8(%rbp), %rsi
callq 0x35b0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x18dca
jmp 0x18e29
movq -0x98(%rbp), %rsi
movl -0x38(%rbp), %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %edx
movl $0x2, %ecx
movq %r9, %rdi
callq 0x35d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x18e27
movl $0x1, -0xcc(%rbp)
jmp 0x18e54
jmp 0x18e29
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl -0x38(%rbp), %eax
je 0x18e3f
movl -0x38(%rbp), %edi
callq 0x3640
jmp 0x18e3d
jmp 0x18e3f
movq -0x8(%rbp), %rdi
callq 0x18c00
jmp 0x18e4a
movl $0x0, -0xcc(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7270
addq $0xd0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x35c0
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/PathUtil.cpp
// Function: t2::PathStripLast(t2::PathBuffer*)
bool PathStripLast(PathBuffer* buffer)
{
  uint16_t min_seg_count = (buffer->m_Flags & PathBuffer::kFlagWindowsDevicePath) ? 1 : 0;
  uint16_t seg_count = buffer->m_SegCount;
  if (seg_count > min_seg_count)
  {
    buffer->m_SegCount = seg_count - 1;
    return true;
  }
  else
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x4(%rax), %edx
andl $0x2, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movw 0x6(%rax), %ax
movw %ax, -0x14(%rbp)
movzwl -0x14(%rbp), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jle 0x193c4
movzwl -0x14(%rbp), %eax
subl $0x1, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x6(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x193c8
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/PathUtil.cpp
// Function: int t2::BufferSize<t2::PathBuffer>(t2::PathBuffer const*, int)
static int BufferSize(const T* path, int seg_count)
{
  CHECK(uint16_t(seg_count) <= path->m_SegCount);

  if (seg_count > 0)
  {
    return path->m_SegEnds[seg_count - 1];
  }
  else
  {
    return 0;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
jmp 0x197dd
cmpl $0x0, -0x14(%rbp)
jle 0x197fa
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzwl 0xa(%rax,%rcx,2), %eax
movl %eax, -0x4(%rbp)
jmp 0x19801
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Profiler.cpp
// Function: t2::ProfilerInit(char const*, int)
void ProfilerInit(const char* fileName, int threadCount)
  {
    CHECK(!g_ProfilerEnabled);
    CHECK(threadCount > 0);

    g_ProfilerEnabled = true;

    s_ProfilerState.m_ThreadCount = threadCount;

    HeapInit(&s_ProfilerState.m_Heap);

    size_t fileNameLen = strlen(fileName);
    s_ProfilerState.m_FileName = (char*)HeapAllocate(&s_ProfilerState.m_Heap, fileNameLen + 1);
    memcpy(s_ProfilerState.m_FileName, fileName, fileNameLen + 1);

    s_ProfilerState.m_Threads = HeapAllocateArray<ProfilerThread>(&s_ProfilerState.m_Heap, s_ProfilerState.m_ThreadCount);
    for (int i = 0; i < s_ProfilerState.m_ThreadCount; ++i)
    {
      ProfilerThread& thread = s_ProfilerState.m_Threads[i];
      thread.m_Events = HeapAllocateArray<ProfilerEvent>(&s_ProfilerState.m_Heap, kProfilerThreadMaxEvents);
      thread.m_EventCount = 0;
      LinearAllocInit(&thread.m_ScratchStrings, &s_ProfilerState.m_Heap, kProfilerThreadStringsSize, "profilerStrings");
      thread.m_IsBegin = false;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
jmp 0x19841
jmp 0x19843
jmp 0x19845
movb $0x1, 0x15e24(%rip)     # 0x2f670
movl -0xc(%rbp), %eax
movl %eax, 0x15e3b(%rip)     # 0x2f690
leaq 0x15e1c(%rip), %rdi     # 0x2f678
callq 0x18920
movq -0x8(%rbp), %rdi
callq 0x3150
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rsi
addq $0x1, %rsi
leaq 0x15dfb(%rip), %rdi     # 0x2f678
callq 0x18940
movq %rax, 0x15df7(%rip)     # 0x2f680
movq 0x15df0(%rip), %rdi     # 0x2f680
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x1, %rdx
callq 0x32a0
movslq 0x15de8(%rip), %rsi     # 0x2f690
leaq 0x15dc9(%rip), %rdi     # 0x2f678
callq 0x19f20
movq %rax, 0x15dcd(%rip)     # 0x2f688
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x15dc5(%rip), %eax     # 0x2f690
jge 0x19939
movq 0x15db4(%rip), %rax     # 0x2f688
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
leaq 0x15d8e(%rip), %rdi     # 0x2f678
movl $0x8000, %esi           # imm = 0x8000
callq 0x19f50
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x28(%rbp), %rdi
leaq 0x15d63(%rip), %rsi     # 0x2f678
movl $0x400000, %edx         # imm = 0x400000
leaq 0xb8cf(%rip), %rcx      # 0x251f0
callq 0x189e0
movq -0x28(%rbp), %rax
movb $0x0, 0x44(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x198c2
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Profiler.cpp
// Function: t2::EscapeString(char const*, char*, int)
static void EscapeString(const char* src, char* dst, int dstSpace)
  {
    while (*src && dstSpace > 2) // some input chars might expand into 2 in the output
    {
      char c = *src;
      switch (c)
      {
      case '"':
      case '\\':
      case '\b':
      case '\f':
      case '\n':
      case '\r':
      case '\t':
        *dst++ = '\\'; *dst++ = c; dstSpace -= 2;
        break;
      default:
        if (c >= 32 && c < 126)
        {
          *dst++ = c; dstSpace -= 1;
        }
      }
      ++src;
    }
    *dst = 0;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpb $0x0, (%rcx)
movb %al, -0x16(%rbp)
je 0x19b47
cmpl $0x2, -0x14(%rbp)
setg %al
movb %al, -0x16(%rbp)
movb -0x16(%rbp), %al
testb $0x1, %al
jne 0x19b53
jmp 0x19c01
movq -0x8(%rbp), %rax
movb (%rax), %al
movb %al, -0x15(%rbp)
movsbl -0x15(%rbp), %eax
movl %eax, -0x1c(%rbp)
addl $-0x8, %eax
subl $0x3, %eax
jb 0x19b8e
jmp 0x19b6d
movl -0x1c(%rbp), %eax
addl $-0xc, %eax
subl $0x2, %eax
jb 0x19b8e
jmp 0x19b7a
movl -0x1c(%rbp), %eax
subl $0x22, %eax
je 0x19b8e
jmp 0x19b84
movl -0x1c(%rbp), %eax
subl $0x5c, %eax
jne 0x19bbf
jmp 0x19b8e
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x5c, (%rax)
movb -0x15(%rbp), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x14(%rbp)
jmp 0x19bf0
movsbl -0x15(%rbp), %eax
cmpl $0x20, %eax
jl 0x19bee
movsbl -0x15(%rbp), %eax
cmpl $0x7e, %eax
jge 0x19bee
movb -0x15(%rbp), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x19bf0
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x19b2f
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Profiler.cpp
// Function: t2::ProfilerDestroy()
void ProfilerDestroy()
  {
    if (!g_ProfilerEnabled)
      return;

    for (int i = 0; i < s_ProfilerState.m_ThreadCount; ++i)
    {
      ProfilerThread& thread = s_ProfilerState.m_Threads[i];
      if (thread.m_IsBegin)
        ProfilerEndImpl(i);
    }

    ProfilerWriteOutput();

    for (int i = 0; i < s_ProfilerState.m_ThreadCount; ++i)
    {
      ProfilerThread& thread = s_ProfilerState.m_Threads[i];
      Log(kSpam, "profiler: thread %i had %d events, %.1f KB strings", i, thread.m_EventCount, double(thread.m_ScratchStrings.m_Offset)/1024.0);
      HeapFree(&s_ProfilerState.m_Heap, thread.m_Events);
      LinearAllocDestroy(&thread.m_ScratchStrings);
    }
    HeapFree(&s_ProfilerState.m_Heap, s_ProfilerState.m_Threads);
    HeapFree(&s_ProfilerState.m_Heap, s_ProfilerState.m_FileName);
    HeapDestroy(&s_ProfilerState.m_Heap);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
testb $0x1, 0x15a51(%rip)     # 0x2f670
jne 0x19c26
jmp 0x19d4c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x15a5a(%rip), %eax     # 0x2f690
jge 0x19c6d
movq 0x15a49(%rip), %rax     # 0x2f688
movslq -0x4(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, 0x44(%rax)
je 0x19c60
movl -0x4(%rbp), %edi
callq 0x19d60
jmp 0x19c62
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x19c2d
callq 0x19940
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x15a0e(%rip), %eax     # 0x2f690
jge 0x19d1a
movq 0x159f9(%rip), %rax     # 0x2f688
movslq -0x14(%rbp), %rcx
leaq (%rcx,%rcx,8), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x40(%rax), %ecx
movq 0x18(%rax), %xmm0
movaps 0xa14b(%rip), %xmm1     # 0x23e00
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0xa14f(%rip), %xmm1     # 0x23e10
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0xb510(%rip), %xmm1     # 0x251e8
divsd %xmm1, %xmm0
movl $0x10, %edi
leaq 0xb6b2(%rip), %rsi      # 0x2539a
movb $0x1, %al
callq 0x7a60
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rsi
leaq 0x1597a(%rip), %rdi     # 0x2f678
callq 0x18960
movq -0x20(%rbp), %rdi
callq 0x18ac0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x19c79
movq 0x15967(%rip), %rsi     # 0x2f688
leaq 0x15950(%rip), %rdi     # 0x2f678
callq 0x18960
movq 0x1594c(%rip), %rsi     # 0x2f680
leaq 0x1593d(%rip), %rdi     # 0x2f678
callq 0x18960
leaq 0x15931(%rip), %rdi     # 0x2f678
callq 0x18930
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Profiler.cpp
// Function: t2::ProfilerEndImpl(int)
void ProfilerEndImpl(int threadIndex)
  {
    CHECK(g_ProfilerEnabled);
    CHECK(threadIndex >= 0 && threadIndex < s_ProfilerState.m_ThreadCount);
    ProfilerThread& thread = s_ProfilerState.m_Threads[threadIndex];
    CHECK(thread.m_IsBegin);
    CHECK(thread.m_EventCount > 0);
    thread.m_IsBegin = false;
    if (thread.m_EventCount > kProfilerThreadMaxEvents)
      return;
    ProfilerEvent& evt = thread.m_Events[thread.m_EventCount-1];
    evt.m_Duration = TimerGet() - evt.m_Time;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
jmp 0x19d6d
jmp 0x19d6f
jmp 0x19d71
movq 0x15910(%rip), %rax     # 0x2f688
movslq -0x4(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x19d89
jmp 0x19d8b
jmp 0x19d8d
movq -0x10(%rbp), %rax
movb $0x0, 0x44(%rax)
movq -0x10(%rbp), %rax
movslq 0x40(%rax), %rax
cmpq $0x8000, %rax           # imm = 0x8000
jbe 0x19da7
jmp 0x19dde
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
callq 0x7d10
movq %rax, %rcx
movq -0x18(%rbp), %rax
subq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Profiler.cpp
// Function: t2::ProfilerBeginImpl(char const*, int)
void ProfilerBeginImpl(const char* name, int threadIndex)
  {
    CHECK(g_ProfilerEnabled);
    CHECK(threadIndex >= 0 && threadIndex < s_ProfilerState.m_ThreadCount);
    ProfilerThread& thread = s_ProfilerState.m_Threads[threadIndex];
    CHECK(!thread.m_IsBegin);
    thread.m_IsBegin = true;
    if (thread.m_EventCount >= kProfilerThreadMaxEvents)
    {
      Log(kWarning, "profiler: max events (%d) reached on thread %i, '%s' and later won't be recorded", (int)kProfilerThreadMaxEvents, threadIndex, name);
      return;
    }
    ProfilerEvent& evt = thread.m_Events[thread.m_EventCount++];
    evt.m_Time = TimerGet();

    // split input name by first space
    const char* nextWord = strchr(name, ' ');
    if (nextWord == nullptr)
    {
      evt.m_Name = StrDup(&thread.m_ScratchStrings, name);
      evt.m_Info = "";
    }
    else
    {
      evt.m_Name = StrDupN(&thread.m_ScratchStrings, name, nextWord - name);
      evt.m_Info = StrDup(&thread.m_ScratchStrings, nextWord + 1);
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
jmp 0x19e01
jmp 0x19e03
jmp 0x19e05
movq 0x1587c(%rip), %rax     # 0x2f688
movslq -0xc(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x19e1d
movq -0x18(%rbp), %rax
movb $0x1, 0x44(%rax)
movq -0x18(%rbp), %rax
movslq 0x40(%rax), %rax
cmpq $0x8000, %rax           # imm = 0x8000
jb 0x19e59
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %r8
movl $0x2, %edi
leaq 0xb585(%rip), %rsi      # 0x253cd
movl $0x8000, %edx           # imm = 0x8000
movb $0x0, %al
callq 0x7a60
jmp 0x19f0e
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x18(%rbp), %rdx
movl 0x40(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x40(%rdx)
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
callq 0x7d10
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl $0x20, %esi
callq 0x3130
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x19ecf
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x15f70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
leaq 0xa512(%rip), %rcx      # 0x243db
movq %rcx, 0x18(%rax)
jmp 0x19f0e
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x8(%rbp), %rax
subq %rax, %rdx
callq 0x15fb0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x1, %rsi
callq 0x15f70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCacheInit(t2::ScanCache*, t2::MemAllocHeap*, t2::MemAllocLinear*)
void ScanCacheInit(ScanCache* self, MemAllocHeap* heap, MemAllocLinear* allocator)
{
  self->m_FrozenData       = nullptr;
  self->m_Heap             = heap;
  self->m_Allocator        = allocator;
  self->m_RecordCount      = 0;
  self->m_TableSize        = 0;
  self->m_Table            = nullptr;
  self->m_FrozenAccess     = nullptr;

  ReadWriteLockInit(&self->m_Lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x1b6b0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCacheSetCache(t2::ScanCache*, t2::ScanData const*)
void ScanCacheSetCache(ScanCache* self, const ScanData* frozen_data)
{
  self->m_FrozenData = frozen_data;

  if (frozen_data)
  {
    self->m_FrozenAccess = HeapAllocateArrayZeroed<uint8_t>(self->m_Heap, frozen_data->m_EntryCount);

    Log(kDebug, "Scan cache initialized from frozen data - %u entries", frozen_data->m_EntryCount);

#if ENABLED(CHECKED_BUILD)
    // Paranoia - make sure the cache is sorted.
    for (int i = 1, count = frozen_data->m_EntryCount; i < count; ++i)
    {
      if (frozen_data->m_Keys[i] < frozen_data->m_Keys[i - 1])
        Croak("Header scanning cache is not sorted");
    }
#endif
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x1a0fc
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x4(%rax), %rsi
callq 0x1b730
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x8, %edi
leaq 0xb329(%rip), %rsi      # 0x2541e
movb $0x0, %al
callq 0x7a60
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::LookupDynamic(t2::ScanCache*, t2::HashDigest const&)
static ScanCache::Record* LookupDynamic(ScanCache* self, const HashDigest& key)
{
  uint32_t table_size = self->m_TableSize;

  if (table_size > 0)
  {
#if ENABLED(USE_SHA1_HASH)
    const uint32_t hash = key.m_Words.m_C;
#elif ENABLED(USE_FAST_HASH)
    const uint32_t hash = key.m_Words32[0];
#endif
    uint32_t index = hash & (table_size - 1);

    ScanCache::Record* chain = self->m_Table[index];
    while (chain)
    {
      if (key == chain->m_Key)
      {
        return chain;
      }

      chain = chain->m_Next;
    }
  }

  return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x54(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jbe 0x1a3de
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1a3dc
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xb910
testb $0x1, %al
jne 0x1a3c4
jmp 0x1a3ce
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1a3e6
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x1a3aa
jmp 0x1a3de
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCachePrepareInsert(t2::ScanCache*)
static void ScanCachePrepareInsert(ScanCache* self)
{
  // Check if a rehash is needed.
  size_t        old_size = self->m_TableSize;

  if (old_size > 0)
  {
    int64_t load = 0x100 * self->m_RecordCount / old_size;
    if (load < 0xc0)
      return;
  }

  MemAllocHeap *heap     = self->m_Heap;
  size_t        new_size = NextPowerOfTwo(uint32_t(old_size + 1));

  if (new_size < 64)
    new_size = 64;

  ScanCache::Record** old_table = self->m_Table;
  ScanCache::Record** new_table = HeapAllocateArrayZeroed<ScanCache::Record*>(heap, new_size);

  for (size_t i = 0; i < old_size; ++i)
  {
    ScanCache::Record* r = old_table[i];
    while (r)
    {
      ScanCache::Record *next  = r->m_Next;
#if ENABLED(USE_SHA1_HASH)
      uint32_t           hash  = r->m_Key.m_Words.m_C;
#elif ENABLED(USE_FAST_HASH)
      uint32_t           hash  = r->m_Key.m_Words32[0];
#endif
      uint32_t           index = hash &(new_size - 1);

      r->m_Next        = new_table[index];
      new_table[index] = r;

      r                = next;
    }
  }

  self->m_TableSize = (uint32_t) new_size;
  self->m_Table     = new_table;

  HeapFree(heap, old_table);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x54(%rax), %eax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0x1a607
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
shll $0x8, %eax
movl %eax, %eax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x10(%rbp)
movq %rax, -0x18(%rbp)
cmpq $0xc0, -0x18(%rbp)
jge 0x1a605
jmp 0x1a708
jmp 0x1a607
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x7ca0
movl %eax, %eax
movq %rax, -0x28(%rbp)
cmpq $0x40, -0x28(%rbp)
jae 0x1a637
movq $0x40, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1ba60
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x1a6e2
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x1a6cf
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
movl %eax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x48(%rbp), %rdx
movq -0x38(%rbp), %rax
movl -0x58(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1a676
jmp 0x1a6d1
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1a65c
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x18960
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCacheDirty(t2::ScanCache*)
bool ScanCacheDirty(ScanCache* self)
{
  bool result;

  ReadWriteLockRead(&self->m_Lock);

  result = self->m_RecordCount > 0;

  ReadWriteUnlockRead(&self->m_Lock);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x1b7f0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x50(%rax)
seta %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
callq 0x1b830
movb -0x9(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCacheWriterInit(t2::ScanCacheWriter*, t2::MemAllocHeap*)
static void ScanCacheWriterInit(ScanCacheWriter* self, MemAllocHeap* heap)
{
  BinaryWriterInit(&self->m_Writer, heap);

  self->m_MainSeg      = BinaryWriterAddSegment(&self->m_Writer);
  self->m_DigestSeg    = BinaryWriterAddSegment(&self->m_Writer);
  self->m_DataSeg      = BinaryWriterAddSegment(&self->m_Writer);
  self->m_TimestampSeg = BinaryWriterAddSegment(&self->m_Writer);
  self->m_ArraySeg     = BinaryWriterAddSegment(&self->m_Writer);
  self->m_StringSeg    = BinaryWriterAddSegment(&self->m_Writer);

  self->m_DigestPtr    = BinarySegmentPosition(self->m_DigestSeg);
  self->m_EntryPtr     = BinarySegmentPosition(self->m_DataSeg);
  self->m_TimestampPtr = BinarySegmentPosition(self->m_TimestampSeg);

  self->m_RecordsOut   = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x20e50
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rdi
callq 0x21190
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x20e20
movl %eax, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x20e20
movl %eax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x20e20
movl %eax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x70(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x78(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x80(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::ScanCacheWriterFlush(t2::ScanCacheWriter*, char const*)
static bool ScanCacheWriterFlush(ScanCacheWriter* self, const char* filename)
{
  BinarySegmentWriteUint32(self->m_MainSeg, ScanData::MagicNumber);
  BinarySegmentWriteUint32(self->m_MainSeg, self->m_RecordsOut);
  BinarySegmentWritePointer(self->m_MainSeg, self->m_DigestPtr);
  BinarySegmentWritePointer(self->m_MainSeg, self->m_EntryPtr);
  BinarySegmentWritePointer(self->m_MainSeg, self->m_TimestampPtr);

  return BinaryWriterFlush(&self->m_Writer, filename);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0x6d072210, %esi       # imm = 0x6D072210
callq 0xbaa0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x80(%rax), %esi
callq 0xbaa0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x58(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x20(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x20db0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x68(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x30(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x20db0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x78(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x40(%rbp), %esi
movq -0x38(%rbp), %rdx
callq 0x20db0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x20f60
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ScanCache.cpp
// Function: t2::WriteUniqueStringPointer(t2::HashTable<t2::BinaryLocator, 0u>*, t2::BinarySegment*, t2::BinarySegment*, unsigned int, char const*)
static void WriteUniqueStringPointer(HashTable<BinaryLocator, kFlagPathStrings>* atoms, BinarySegment* out_segment, BinarySegment* string_segment, uint32_t hash, const char* filename)
{
  if (const BinaryLocator* l = HashTableLookup(atoms, hash, filename))
  {
    BinarySegmentWritePointer(out_segment, *l);
    return;
  }

  BinaryLocator pos = BinarySegmentPosition(string_segment);
  HashTableInsert(atoms, hash, filename, pos);

  BinarySegmentWritePointer(out_segment, pos);
  BinarySegmentWriteStringData(string_segment, filename);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x1c8f0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1b49b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x40(%rbp), %esi
movq -0x38(%rbp), %rdx
callq 0x20db0
jmp 0x1b4ec
movq -0x18(%rbp), %rdi
callq 0x20e20
movl %eax, -0x50(%rbp)
movq %rdx, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x1c950
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x60(%rbp), %esi
movq -0x58(%rbp), %rdx
callq 0x20db0
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb800
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Scanner.cpp
// Function: t2::IncludeSetAddNoDuplicateString(t2::IncludeSet*, char const*, unsigned int)
static bool IncludeSetAddNoDuplicateString(IncludeSet* self, const char* string, uint32_t hash)
{
  if (HashSetLookup(&self->m_HashTable, hash, string))
  {
    return false;
  }

  // Allocate a new cell
  HashSetInsert(&self->m_HashTable, hash, string);

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x15cd0
testb $0x1, %al
jne 0x1d23d
jmp 0x1d243
movb $0x0, -0x1(%rbp)
jmp 0x1d25b
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x15d10
movb $0x1, -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/Scanner.cpp
// Function: t2::ScanFile(t2::StatCache*, char const*, char*, t2::ScanInput const*, t2::Buffer<char const*>*)
static void ScanFile(
    StatCache* stat_cache,
    const char* filename,
    char* file_data,
    const ScanInput* input,
    Buffer<const char*>* found_includes)
{
  MemAllocHeap      *heap           = input->m_ScratchHeap;
  MemAllocLinear    *scratch        = input->m_ScratchAlloc;
  const ScannerData *scanner_config = input->m_ScannerConfig;
  IncludeData       *includes       = nullptr;

  switch (scanner_config->m_ScannerType)
  {
    case ScannerType::kGeneric:
      includes = ScanIncludesGeneric(file_data, scratch, *static_cast<const GenericScannerData*>(scanner_config));
      break;
    case ScannerType::kCpp:
      includes = ScanIncludesCpp(file_data, scratch);
      break;
    default:
      Croak("Unsupported scanner type");
  }

  // Resolve includes to file paths.
  IncludeData* include = includes;

  while (include)
  {
    PathBuffer path;
    char path_buf[kMaxPathLength];

    if (FindFile(stat_cache, &path, path_buf, filename, scanner_config, include))
    {
      BufferAppendOne(found_includes, heap, StrDup(scratch, path_buf));
    }

    include = include->m_Next;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1d810
movl %eax, %ecx
movl %ecx, -0x4e4(%rbp)
testl %eax, %eax
je 0x1d2f5
jmp 0x1d2d1
movl -0x4e4(%rbp), %eax
subl $0x1, %eax
jne 0x1d308
jmp 0x1d2de
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x21be0
movq %rax, -0x48(%rbp)
jmp 0x1d316
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x21930
movq %rax, -0x48(%rbp)
jmp 0x1d316
leaq 0x81d4(%rip), %rdi      # 0x254e3
movb $0x0, %al
callq 0x75a0
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x1d398
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x50(%rbp), %r9
leaq -0x2dc(%rbp), %rsi
leaq -0x4e0(%rbp), %rdx
callq 0x1d4f0
testb $0x1, %al
jne 0x1d34e
jmp 0x1d38a
movq -0x28(%rbp), %rax
movq %rax, -0x4f8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x4f0(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x4e0(%rbp), %rsi
callq 0x15f70
movq -0x4f8(%rbp), %rdi
movq -0x4f0(%rbp), %rsi
movq %rax, %rdx
callq 0x1d820
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1d31e
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Scanner.cpp
// Function: t2::IncludeSetAddDuplicateString(t2::IncludeSet*, char const*, unsigned int)
static bool IncludeSetAddDuplicateString(IncludeSet* self, const char* string, uint32_t hash)
{
  if (HashSetLookup(&self->m_HashTable, hash, string))
  {
    return false;
  }

  // Allocate a new cell
  HashSetInsert(&self->m_HashTable, hash, StrDup(self->m_LinearAlloc, string));

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movl -0x1c(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x15cd0
testb $0x1, %al
jne 0x1d3dd
jmp 0x1d3e3
movb $0x0, -0x1(%rbp)
jmp 0x1d418
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x15f70
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %esi
movq %rax, %rdx
callq 0x15d10
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)