LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Scanner.cpp
// Function: t2::FindFile(t2::StatCache*, t2::PathBuffer*, char (&) [512], char const*, t2::ScannerData const*, t2::IncludeData const*)
static bool FindFile(
    StatCache* stat_cache, 
    PathBuffer* buffer,
    char (&path_buf)[kMaxPathLength],
    const char* filename,
    const ScannerData* scanner_config,
    const IncludeData* include)
{
  PathBuffer filename_buf;
  PathInit(&filename_buf, filename);

  PathBuffer include_buf;
  PathInit(&include_buf, include->m_String);

  if (!include->m_IsSystemInclude)
  {
    // Try a relative include path for ""-style includes.
    *buffer = filename_buf;
    PathStripLast(buffer);
    PathConcat(buffer, &include_buf);
    PathFormat(path_buf, buffer);
    FileInfo info = StatCacheStat(stat_cache, path_buf);
    if (info.Exists())
      return true;
  }

  for (const char* include_path : scanner_config->m_IncludePaths)
  {
    PathInit(buffer, include_path);
    PathConcat(buffer, &include_buf);
    PathFormat(path_buf, buffer);

    FileInfo info = StatCacheStat(stat_cache, path_buf);
    if (info.Exists())
      return true;
  }

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x28(%rbp), %rsi
leaq -0x2c4(%rbp), %rdi
xorl %edx, %edx
callq 0x18e70
movq -0x38(%rbp), %rax
movq (%rax), %rsi
leaq -0x550(%rbp), %rdi
xorl %edx, %edx
callq 0x18e70
movq -0x38(%rbp), %rax
testb $0x1, 0x10(%rax)
jne 0x1d5b0
movq -0x18(%rbp), %rdi
leaq -0x2c4(%rbp), %rsi
movl $0x28c, %edx            # imm = 0x28C
callq 0x32a0
movq -0x18(%rbp), %rdi
callq 0x19370
movq -0x18(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x19410
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x195c0
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x568(%rbp), %rdi
callq 0x7420
leaq -0x568(%rbp), %rdi
callq 0x71b0
testb $0x1, %al
jne 0x1d5a5
jmp 0x1d5ae
movb $0x1, -0x1(%rbp)
jmp 0x1d684
jmp 0x1d5b0
movq -0x30(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x570(%rbp)
movq -0x570(%rbp), %rdi
callq 0x14990
movq %rax, -0x578(%rbp)
movq -0x570(%rbp), %rdi
callq 0x149b0
movq %rax, -0x580(%rbp)
movq -0x578(%rbp), %rax
cmpq -0x580(%rbp), %rax
je 0x1d680
movq -0x578(%rbp), %rdi
callq 0x6e20
movq %rax, -0x588(%rbp)
movq -0x18(%rbp), %rdi
movq -0x588(%rbp), %rsi
xorl %edx, %edx
callq 0x18e70
movq -0x18(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x19410
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x195c0
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x5a0(%rbp), %rdi
callq 0x7420
leaq -0x5a0(%rbp), %rdi
callq 0x71b0
testb $0x1, %al
jne 0x1d661
jmp 0x1d667
movb $0x1, -0x1(%rbp)
jmp 0x1d684
jmp 0x1d669
movq -0x578(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x578(%rbp)
jmp 0x1d5e5
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SignalHandler.cpp
// Function: t2::SignalGetReason()
const char* SignalGetReason(void)
{
  MutexLock(&s_SignalMutex);
  const char* result = s_SignalInfo.m_Reason;
  MutexUnlock(&s_SignalMutex);
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x11d49(%rip), %rdi     # 0x2f698
callq 0x69b0
movq 0x11d6d(%rip), %rax     # 0x2f6c8
movq %rax, -0x8(%rbp)
leaq 0x11d32(%rip), %rdi     # 0x2f698
callq 0x69f0
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SignalHandler.cpp
// Function: t2::SignalSet(char const*)
void SignalSet(const char* reason)
{
  MutexLock(&s_SignalMutex);

  s_SignalInfo.m_Signalled = true;
  s_SignalInfo.m_Reason    = reason;

  if (ConditionVariable* cvar = s_SignalCond)
    CondBroadcast(cvar);

  MutexUnlock(&s_SignalMutex);

#if defined(TUNDRA_WIN32)
  // Also signal this event - build threads waiting on external programs are stuck in WaitForMultipleObjects()
  // and can't wait for a condition variable at the same time.
  SetEvent(s_SignalHandle);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x11d05(%rip), %rdi     # 0x2f698
callq 0x69b0
movb $0x1, 0x11d21(%rip)     # 0x2f6c0
movq -0x8(%rbp), %rax
movq %rax, 0x11d1e(%rip)     # 0x2f6c8
movq 0x11d1f(%rip), %rax     # 0x2f6d0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1d9c5
movq -0x10(%rbp), %rdi
callq 0x6a30
leaq 0x11ccc(%rip), %rdi     # 0x2f698
callq 0x69f0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SignalHandler.cpp
// Function: t2::SignalHandlerInit()
void SignalHandlerInit()
{
  MutexInit(&s_SignalMutex);

#if defined(TUNDRA_UNIX)
	{
		pthread_t sigthread;
		if (0 != pthread_create(&sigthread, NULL, PosixSignalHandlerThread, NULL))
			CroakErrno("couldn't start signal handler thread");
		pthread_detach(sigthread);
	}
#elif defined(TUNDRA_WIN32)
  s_SignalHandle = CreateEvent(NULL, TRUE, FALSE, NULL);
  SetConsoleCtrlHandler(WindowsSignalHandlerFunc, TRUE);
#else
#error Meh
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x11ca9(%rip), %rdi     # 0x2f698
callq 0x6810
leaq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x2d(%rip), %rdx        # 0x1da30
movq %rcx, %rsi
callq 0x35f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x1da21
leaq 0x7ae5(%rip), %rdi      # 0x254ff
movb $0x0, %al
callq 0x7680
movq -0x8(%rbp), %rdi
callq 0x3240
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SignalHandler.cpp
// Function: t2::PosixSignalHandlerThread(void*)
static void* PosixSignalHandlerThread(void *arg)
{
  (void)arg; // unused

  int sig, rc;
  sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGINT);
  sigaddset(&sigs, SIGTERM);
  sigaddset(&sigs, SIGQUIT);
  if (0 == (rc = sigwait(&sigs, &sig)))
  {
    const char *reason = "unknown";
    switch (sig)
    {
      case SIGINT:  reason = "SIGINT";  break;
      case SIGTERM: reason = "SIGTERM"; break;
      case SIGQUIT: reason = "SIGQUIT"; break;
    }
    SignalSet(reason);
  }
  else
    CroakErrno("sigwait() failed");

  return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3420
leaq -0x90(%rbp), %rdi
movl $0x2, %esi
callq 0x3520
leaq -0x90(%rbp), %rdi
movl $0xf, %esi
callq 0x3520
leaq -0x90(%rbp), %rdi
movl $0x3, %esi
callq 0x3520
leaq -0x90(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x30e0
movl %eax, %ecx
movl %ecx, -0x10(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1db0d
leaq 0x7a9b(%rip), %rax      # 0x2553b
movq %rax, -0x98(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x9c(%rbp)
subl $0x2, %eax
je 0x1dad1
jmp 0x1dab7
movl -0x9c(%rbp), %eax
subl $0x3, %eax
je 0x1daf1
jmp 0x1dac4
movl -0x9c(%rbp), %eax
subl $0xf, %eax
je 0x1dae1
jmp 0x1daff
leaq 0x7a6b(%rip), %rax      # 0x25543
movq %rax, -0x98(%rbp)
jmp 0x1daff
leaq 0x7a62(%rip), %rax      # 0x2554a
movq %rax, -0x98(%rbp)
jmp 0x1daff
leaq 0x7a5a(%rip), %rax      # 0x25552
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x1d980
jmp 0x1db1b
leaq 0x7a46(%rip), %rdi      # 0x2555a
movb $0x0, %al
callq 0x7680
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/SignalHandler.cpp
// Function: t2::SignalBlockThread(bool)
void SignalBlockThread(bool block)
{
	sigset_t sigs;
	sigemptyset(&sigs);
	sigaddset(&sigs, SIGINT);
	sigaddset(&sigs, SIGTERM);
	sigaddset(&sigs, SIGQUIT);
	if  (0 != pthread_sigmask(block ? SIG_BLOCK : SIG_UNBLOCK, &sigs, 0))
		CroakErrno("pthread_sigmask failed");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3420
leaq -0x88(%rbp), %rdi
movl $0x2, %esi
callq 0x3520
leaq -0x88(%rbp), %rdi
movl $0xf, %esi
callq 0x3520
leaq -0x88(%rbp), %rdi
movl $0x3, %esi
callq 0x3520
movb -0x1(%rbp), %cl
movl $0x1, %edi
xorl %eax, %eax
testb $0x1, %cl
cmovnel %eax, %edi
leaq -0x88(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x30b0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x1dc18
leaq 0x7913(%rip), %rdi      # 0x25524
movb $0x0, %al
callq 0x7680
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/StatCache.cpp
// Function: t2::StatCacheInit(t2::StatCache*, t2::MemAllocLinear*, t2::MemAllocHeap*)
void StatCacheInit(StatCache* self, MemAllocLinear* allocator, MemAllocHeap* heap)
{
  self->m_Allocator      = allocator;
  self->m_Heap           = heap;
  HashTableInit(&self->m_Files, heap);
  ReadWriteLockInit(&self->m_HashLock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x18(%rbp), %rsi
callq 0x1de50
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b6b0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/StatCache.cpp
// Function: t2::StatCacheMarkDirty(t2::StatCache*, char const*, unsigned int)
void StatCacheMarkDirty(StatCache* self, const char* path, uint32_t hash)
{
  ReadWriteLockWrite(&self->m_HashLock);

  if (FileInfo* fi = HashTableLookup(&self->m_Files, hash, path))
  {
    fi->m_Flags = FileInfo::kFlagDirty;
  }

  ReadWriteUnlockWrite(&self->m_HashLock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b870
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x1ded0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1dcf9
movq -0x20(%rbp), %rax
movl $0x40000000, (%rax)     # imm = 0x40000000
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b8e0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/StatCache.cpp
// Function: t2::StatCacheStat(t2::StatCache*, char const*, unsigned int)
FileInfo StatCacheStat(StatCache* self, const char* path, uint32_t hash)
{
  ReadWriteLockRead(&self->m_HashLock);

  const FileInfo* fi = HashTableLookup(&self->m_Files, hash, path);

  if (fi != nullptr && 0 == (fi->m_Flags & FileInfo::kFlagDirty))
  {
    FileInfo result = *fi;
    ReadWriteUnlockRead(&self->m_HashLock);
    return result;
  }

  ReadWriteUnlockRead(&self->m_HashLock);

  AtomicIncrement(&g_Stats.m_StatCacheMisses);
  FileInfo file_info = GetFileInfo(path);

  // There's a natural race condition here. Some other thread might come in,
  // stat the file and insert it before us. We just let that happen. The DAG
  // guarantees that we won't be writing to files that are being stat'd here,
  // so the result of these races is benign.
  StatCacheInsert(self, hash, path, file_info);
  return file_info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, -0x28(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b7f0
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x1ded0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1dd96
movq -0x20(%rbp), %rax
movl (%rax), %ecx
andl $0x40000000, %ecx       # imm = 0x40000000
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1dd96
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rax)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b830
jmp 0x1ddd4
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
callq 0x1b830
leaq 0x117e6(%rip), %rdi     # 0x2f590
addq $0x74, %rdi
callq 0x74e0
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x16920
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x1dde0
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/TargetSelect.cpp
// Function: t2::FindHash(int*, unsigned int const*, int, unsigned int)
static bool FindHash(int* index_out, const uint32_t* hashes, int count, uint32_t hash)
{
  for (int i = 0; i < count; ++i)
  {
    if (hashes[i] == hash)
    {
      *index_out = i;
      return true;
    }
  }

  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1e6cd
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x20(%rbp), %eax
jne 0x1e6c0
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1e6d1
jmp 0x1e6c2
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1e699
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/TargetSelect.hpp
// Function: t2::operator==(t2::TargetSpec const&, t2::TargetSpec const&)
inline bool operator==(const TargetSpec& l, const TargetSpec& r)
{
  return
    l.m_ConfigIndex == r.m_ConfigIndex &&
    l.m_VariantIndex == r.m_VariantIndex &&
    l.m_SubVariantIndex == r.m_SubVariantIndex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, -0x11(%rbp)
jne 0x1e9d8
movq -0x8(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpl 0x4(%rdx), %ecx
movb %al, -0x11(%rbp)
jne 0x1e9d8
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
sete %al
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ExecUnix.cpp
// Function: t2::SetFdNonBlocking(int)
static void SetFdNonBlocking(int fd)
{
	int flags;

	flags = fcntl(fd, F_GETFL);
	flags |= O_NONBLOCK;
	if (-1 == fcntl(fd, F_SETFL, flags))
		CroakErrno("couldn't unblock fd %d", fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x31f0
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %edx
movl $0x4, %esi
movb $0x0, %al
callq 0x31f0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x1f296
movl -0x4(%rbp), %esi
leaq 0x63e8(%rip), %rdi      # 0x25677
movb $0x0, %al
callq 0x7680
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/ExecUnix.cpp
// Function: t2::EmitData(int, int, int, int)
static int
EmitData(int job_id, int is_stderr, int sort_key, int fd)
{
	char text[8192];
	ssize_t count;

	count = read(fd, text, sizeof(text)-1);

	if (count <= 0)
	{
		if (EAGAIN == errno)
			return 0;
		else
			return -1;
	}

	text[count] = '\0';

	TerminalIoEmit(job_id, is_stderr, sort_key, text, count);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2030, %rsp           # imm = 0x2030
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %edi
leaq -0x2020(%rbp), %rsi
movl $0x1fff, %edx           # imm = 0x1FFF
callq 0x3480
movq %rax, -0x2028(%rbp)
cmpq $0x0, -0x2028(%rbp)
jg 0x1f2ff
callq 0x3050
movq %rax, %rcx
movl $0xb, %eax
cmpl (%rcx), %eax
jne 0x1f2f6
movl $0x0, -0x4(%rbp)
jmp 0x1f334
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1f334
movq -0x2028(%rbp), %rax
movb $0x0, -0x2020(%rbp,%rax)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
leaq -0x2020(%rbp), %rcx
movq -0x2028(%rbp), %rax
movl %eax, %r8d
callq 0x221e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x2030, %rsp           # imm = 0x2030
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/DigestCache.cpp
// Function: t2::DigestCacheInit(t2::DigestCache*, unsigned long)
void DigestCacheInit(DigestCache* self, size_t heap_size)
{
  ReadWriteLockInit(&self->m_Lock);

  self->m_State = nullptr;

  HeapInit(&self->m_Heap);
  LinearAllocInit(&self->m_Allocator, &self->m_Heap, heap_size / 2, "digest allocator");
  MmapFileInit(&self->m_StateFile);
  HashTableInit(&self->m_Table, &self->m_Heap);

  self->m_AccessTime = time(nullptr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b6b0
movq -0x8(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x18920
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x8(%rbp), %rsi
addq $0x40, %rsi
movq -0x10(%rbp), %rdx
shrq %rdx
leaq 0x62fe(%rip), %rcx      # 0x2568e
callq 0x189e0
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
callq 0x18be0
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
movq -0x8(%rbp), %rsi
addq $0x40, %rsi
callq 0x1fb30
xorl %eax, %eax
movl %eax, %edi
callq 0x3310
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xd0(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/DigestCache.cpp
// Function: t2::DigestCacheDestroy(t2::DigestCache*)
void DigestCacheDestroy(DigestCache* self)
{
  HashTableDestroy(&self->m_Table);
  MmapFileDestroy(&self->m_StateFile);
  LinearAllocDestroy(&self->m_Allocator);
  HeapDestroy(&self->m_Heap);
  ReadWriteLockDestroy(&self->m_Lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
callq 0x1fc40
movq -0x8(%rbp), %rdi
addq $0x80, %rdi
callq 0x18c40
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x18ac0
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x18930
movq -0x8(%rbp), %rdi
callq 0x1b6f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/HashTable.hpp
// Function: void t2::HashTableWalk<t2::DigestCacheRecord, 0u, t2::DigestCacheSave(t2::DigestCache*, t2::MemAllocHeap*, char const*, char const*)::$_0>(t2::HashTable<t2::DigestCacheRecord, 0u>*, t2::DigestCacheSave(t2::DigestCache*, t2::MemAllocHeap*, char const*, char const*)::$_0)
void HashTableWalk(HashTable<T, kFlags>* self, Callback callback)
  {
    uint32_t* hashes = self->m_Hashes;
    const char** strings = self->m_Strings;
    const T* payloads = self->m_Payloads;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jae 0x1f8aa
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x1f89d
movl -0x34(%rbp), %eax
movl %eax, %esi
movl -0x40(%rbp), %edx
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
movq -0x30(%rbp), %r8
movl -0x38(%rbp), %eax
shlq $0x5, %rax
addq %rax, %r8
leaq -0x10(%rbp), %rdi
callq 0x1fa60
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1f89f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x1f84f
jmp 0x1f8ac
jmp 0x1f8ae
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/DigestCache.cpp
// Function: t2::DigestCacheGet(t2::DigestCache*, char const*, unsigned int, unsigned long, t2::HashDigest*)
bool DigestCacheGet(DigestCache* self, const char* filename, uint32_t hash, uint64_t timestamp, HashDigest* digest_out)
{
  bool result = false;

  ReadWriteLockRead(&self->m_Lock);

  if (DigestCacheRecord* r = (DigestCacheRecord*) HashTableLookup(&self->m_Table, hash, filename))
  {
    if (r->m_Timestamp == timestamp)
    {
      // Technically violates r/w lock - doesn't matter
      r->m_AccessTime = self->m_AccessTime;
      *digest_out     = r->m_ContentDigest;
      result          = true;
    }
  }

  ReadWriteUnlockRead(&self->m_Lock);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b7f0
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x1fc90
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1f947
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x20(%rbp), %rax
jne 0x1f945
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movb $0x1, -0x29(%rbp)
jmp 0x1f947
movq -0x8(%rbp), %rdi
callq 0x1b830
movb -0x29(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/DigestCache.cpp
// Function: t2::DigestCacheSet(t2::DigestCache*, char const*, unsigned int, unsigned long, t2::HashDigest const&)
void DigestCacheSet(DigestCache* self, const char* filename, uint32_t hash, uint64_t timestamp, const HashDigest& digest)
{
  ReadWriteLockWrite(&self->m_Lock);

  DigestCacheRecord* r;

  if (nullptr != (r = (DigestCacheRecord*) HashTableLookup(&self->m_Table, hash, filename)))
  {
    r->m_Timestamp     = timestamp;
    r->m_ContentDigest = digest;
    r->m_AccessTime    = self->m_AccessTime;
  }
  else
  {
    DigestCacheRecord r;
    r.m_ContentDigest = digest;
    r.m_Timestamp     = timestamp;
    r.m_AccessTime    = self->m_AccessTime;
    HashTableInsert(&self->m_Table, hash, StrDup(&self->m_Allocator, filename), r);
  }

  ReadWriteUnlockWrite(&self->m_Lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1b870
movq -0x8(%rbp), %rdi
addq $0xa0, %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x1fc90
movq %rax, %rcx
movq %rcx, -0x30(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1f9e0
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x1fa42
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x50(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rax
movq %rax, -0x60(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
movq -0x10(%rbp), %rsi
callq 0x15f70
movq -0x60(%rbp), %rdi
movl -0x54(%rbp), %esi
movq %rax, %rdx
leaq -0x50(%rbp), %rcx
callq 0x1fbc0
movq -0x8(%rbp), %rdi
callq 0x1b8e0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/FileSign.cpp
// Function: t2::ComputeFileSignature(t2::HashState*, t2::StatCache*, t2::DigestCache*, char const*, unsigned int, unsigned int const*, int)
void ComputeFileSignature(
  HashState*          out,
  StatCache*          stat_cache,
  DigestCache*        digest_cache,
  const char*         filename,
  uint32_t            fn_hash,
  const uint32_t      sha_extension_hashes[],
  int                 sha_extension_hash_count)
{
  if (const char* ext = strrchr(filename, '.'))
  {
    uint32_t ext_hash = Djb2Hash(ext);
    for (int i  = 0; i < sha_extension_hash_count; ++i)
    {
      if (sha_extension_hashes[i] == ext_hash)
      {
        ComputeFileSignatureSha1(out, stat_cache, digest_cache, filename, fn_hash);
        return;
      }
    }
  }

  ComputeFileSignatureTimestamp(out, stat_cache, filename, fn_hash);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x3380
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x20111
movq -0x38(%rbp), %rdi
callq 0x7860
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x2010f
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x3c(%rbp), %eax
jne 0x20102
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
callq 0x20130
jmp 0x20125
jmp 0x20104
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x200cf
jmp 0x20111
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x20320
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/FileSign.cpp
// Function: t2::ComputeFileSignatureTimestamp(t2::HashState*, t2::StatCache*, char const*, unsigned int)
static bool ComputeFileSignatureTimestamp(HashState* out, StatCache* stat_cache, const char* filename, uint32_t hash)
{
  FileInfo info = StatCacheStat(stat_cache, filename, hash);
  if (info.Exists())
    HashAddInteger(out, info.m_Timestamp);
  else
    HashAddInteger(out, ~0ull);
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
leaq -0x38(%rbp), %rdi
callq 0x1dd10
leaq -0x38(%rbp), %rdi
callq 0x71b0
testb $0x1, %al
jne 0x2035a
jmp 0x20369
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x170b0
jmp 0x20379
movq -0x8(%rbp), %rdi
movq $-0x1, %rsi
callq 0x170b0
xorl %eax, %eax
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/FileSign.cpp
// Function: t2::CalculateGlobSignatureFor(char const*, t2::MemAllocHeap*, t2::MemAllocLinear*)::IterContext::Init(t2::MemAllocHeap*, t2::MemAllocLinear*)
void Init(MemAllocHeap* heap, MemAllocLinear* linear)
      {
        m_Allocator = linear;
        m_Heap      = heap;
        BufferInit(&m_Dirs);
        BufferInit(&m_Files);
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, (%rdi)
movq -0x10(%rbp), %rax
movq %rax, 0x8(%rdi)
addq $0x10, %rdi
callq 0x14c60
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
callq 0x14c60
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/FileSign.cpp
// Function: t2::CalculateGlobSignatureFor(char const*, t2::MemAllocHeap*, t2::MemAllocLinear*)::IterContext::Callback(void*, t2::FileInfo const&, char const*)
static void Callback(void* user_data, const FileInfo& info, const char* path)
      {
        IterContext* self = (IterContext*) user_data;
        char* data = StrDup(self->m_Allocator, path);
        Buffer<const char*>* target = info.IsDirectory() ? &self->m_Dirs : &self->m_Files;
        BufferAppendOne(target, self->m_Heap, data);
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x15f70
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20720
testb $0x1, %al
jne 0x2066f
jmp 0x2067d
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x38(%rbp)
jmp 0x20689
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rdx
callq 0x1d820
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/HashFast.cpp
// Function: t2::HashInitImpl(t2::HashStateImpl*)
void HashInitImpl(HashStateImpl* self)
{
  uint32_t seeds[4] = { 0x89caf13a, 0x179fa534, 0x5199afcc, 0xef901315 };

  for (int i = 0; i < 4; ++i)
  {
    uint32_t seed = seeds[i];
    self->m_V[i][0] = seed + kPrime32_1 + kPrime32_2;
    self->m_V[i][1] = seed + kPrime32_2;
    self->m_V[i][2] = seed;
    self->m_V[i][3] = seed - kPrime32_1;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq 0x4c31(%rip), %rax      # 0x256f0
movq %rax, -0x20(%rbp)
movq 0x4c2e(%rip), %rax      # 0x256f8
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x20b63
movslq -0x24(%rbp), %rax
movl -0x20(%rbp,%rax,4), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
addl $0x9e3779b1, %ecx       # imm = 0x9E3779B1
addl $0x85ebca77, %ecx       # imm = 0x85EBCA77
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl -0x28(%rbp), %ecx
addl $0x85ebca77, %ecx       # imm = 0x85EBCA77
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x28(%rbp), %ecx
subl $0x9e3779b1, %ecx       # imm = 0x9E3779B1
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x20ad5
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/HashFast.cpp
// Function: t2::HashFinalizeImpl(t2::HashStateImpl*, t2::HashDigest*)
void HashFinalizeImpl(HashStateImpl* state, HashDigest* digest)
{
  for (int v = 0; v < 4; ++v)
  {
    uint32_t v0 = state->m_V[v][0];
    uint32_t v1 = state->m_V[v][1];
    uint32_t v2 = state->m_V[v][2];
    uint32_t v3 = state->m_V[v][3];

    uint32_t h32 = RotateLeft(v0, 1) + RotateLeft(v1, 7) + RotateLeft(v2, 12) + RotateLeft(v3, 18);

    h32 ^= h32 >> 15;
    h32 *= kPrime32_2;
    h32 ^= h32 >> 13;
    h32 *= kPrime32_3;
    h32 ^= h32 >> 16;

    digest->m_Words32[v] = h32;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x20c8d
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %edi
movl $0x1, %esi
callq 0x20a80
movl %eax, -0x34(%rbp)
movl -0x1c(%rbp), %edi
movl $0x7, %esi
callq 0x20a80
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x30(%rbp)
movl -0x20(%rbp), %edi
movl $0xc, %esi
callq 0x20a80
movl %eax, %ecx
movl -0x30(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %edi
movl $0x12, %esi
callq 0x20a80
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl $0xf, %eax
xorl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
imull $0x85ebca77, -0x28(%rbp), %eax # imm = 0x85EBCA77
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl $0xd, %eax
xorl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
imull $0xc2b2ae3d, -0x28(%rbp), %eax # imm = 0xC2B2AE3D
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
shrl $0x10, %eax
xorl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x20b87
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinarySegmentAlign(t2::BinarySegment*, unsigned long)
void BinarySegmentAlign(BinarySegment* self, size_t alignment)
{
  size_t offset  = self->m_Bytes.m_Size;
  size_t aligned = (offset + alignment - 1) & ~(alignment - 1);
  size_t delta   = aligned - offset;

  while (delta--)
  {
    BufferAppendOne(&self->m_Bytes, self->m_Heap, 0xfe);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq -0x10(%rbp), %rax
subq $0x1, %rax
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
subq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x28(%rbp)
cmpq $0x0, %rax
je 0x20d38
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0xfe, %edx
callq 0x21350
jmp 0x20d07
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinarySegmentWritePointer(t2::BinarySegment*, t2::BinaryLocator)
void BinarySegmentWritePointer(BinarySegment* seg, BinaryLocator locator)
{
  BinaryFixup* fixup = BufferAlloc(&seg->m_Fixups, seg->m_Heap, 1);
  fixup->m_PointerOffset = seg->m_Bytes.m_Size;
  fixup->m_Target        = locator;

  // Write dummy value to be fixed up later
  BinarySegmentWriteUint32(seg, 0x7eeeeeee);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %esi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %edx
callq 0x214c0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rdi
movl $0x7eeeeeee, %esi       # imm = 0x7EEEEEEE
callq 0xbaa0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinaryWriterDestroy(t2::BinaryWriter*)
void BinaryWriterDestroy(BinaryWriter* self)
{
  for (BinarySegment* seg : self->m_Segments)
  {
    BinarySegmentDestroy(seg);
    HeapFree(self->m_Heap, seg);
  }

  BufferDestroy(&self->m_Segments, self->m_Heap);
  self->m_Heap = nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x215d0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x215f0
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x20eee
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x20f20
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x18960
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x20eb2
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
callq 0x21610
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinaryWriterFlush(t2::BinaryWriter*, char const*)
bool BinaryWriterFlush(BinaryWriter* self, const char* out_fn)
{
  if (!BinaryWriterFinalize(self))
    return false;

  FILE* f = fopen(out_fn, "wb");
  if (!f)
    return false;
  
  bool success = true;

  const size_t seg_count = self->m_Segments.m_Size;
  BinarySegment** segs = self->m_Segments.m_Storage;

  // Align all segments to 16 bytes
  for (size_t i = 0; success && i < seg_count; ++i)
  {
    success = BinarySegmentWrite(segs[i], f);
  }

  fclose(f);
  return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x21040
testb $0x1, %al
jne 0x20f86
movb $0x0, -0x1(%rbp)
jmp 0x21026
movq -0x18(%rbp), %rdi
leaq 0x476f(%rip), %rsi      # 0x25700
callq 0x33c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x20fa7
movb $0x0, -0x1(%rbp)
jmp 0x21026
movb $0x1, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
xorl %eax, %eax
testb $0x1, -0x21(%rbp)
movb %al, -0x41(%rbp)
je 0x20fe4
movq -0x40(%rbp), %rax
cmpq -0x30(%rbp), %rax
setb %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x20fed
jmp 0x21015
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rsi
callq 0x21130
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x20fcb
movq -0x20(%rbp), %rdi
callq 0x3350
movb -0x21(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinaryWriterFinalize(t2::BinaryWriter*)
static bool BinaryWriterFinalize(BinaryWriter* w)
{
  const size_t seg_count = w->m_Segments.m_Size;
  BinarySegment** segs = w->m_Segments.m_Storage;

  // Align all segments to 16 bytes
  for (size_t i = 0; i < seg_count; ++i)
  {
    BinarySegmentAlign(segs[i], 16);
  }

  // Compute global segment positions
  size_t offset = 0;
  for (size_t i = 0; i < seg_count; ++i)
  {
    segs[i]->m_GlobalOffset = offset;
    offset += BinarySegmentSize(segs[i]);
  }

  // Fix up pointers wrt global segment positions
  for (size_t i = 0; i < seg_count; ++i)
  {
    BinarySegmentFixupPointers(segs[i], segs);
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x2109a
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movl $0x10, %esi
callq 0x20cc0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x2106c
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x210ef
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20ca0
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x210aa
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x21124
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0x21260
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x210f7
movb $0x1, %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinaryWriterAddSegment(t2::BinaryWriter*)
BinarySegment* BinaryWriterAddSegment(BinaryWriter* self)
{
  BinarySegment* seg = (BinarySegment*) HeapAllocate(self->m_Heap, sizeof(BinarySegment));
  BinarySegmentInit(seg, (int) self->m_Segments.m_Size, self->m_Heap);
  BufferAppendOne(&self->m_Segments, self->m_Heap, seg);
  return seg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x48, %esi
callq 0x18940
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
callq 0x211f0
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0x21670
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinarySegmentInit(t2::BinarySegment*, int, t2::MemAllocHeap*)
static void BinarySegmentInit(BinarySegment* self, int index, MemAllocHeap* heap)
{
  self->m_Index        = index;
  self->m_GlobalOffset = -1;
  self->m_Heap         = heap;
  BufferInitWithCapacity(&self->m_Bytes, heap, 128 * 1024);
  BufferInitWithCapacity(&self->m_Fixups, heap, 4096);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq $-0x1, 0x8(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movq -0x18(%rbp), %rsi
movl $0x20000, %edx          # imm = 0x20000
callq 0x217b0
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x21800
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BinaryWriter.cpp
// Function: t2::BinarySegmentFixupPointers(t2::BinarySegment*, t2::BinarySegment**)
static void BinarySegmentFixupPointers(BinarySegment* self, BinarySegment** segs)
{
  int64_t my_seg_base = self->m_GlobalOffset;

  for (auto const& fixup : self->m_Fixups)
  {
    int64_t  target_seg_base = segs[fixup.m_Target.m_SegIndex]->m_GlobalOffset;

    int64_t  source_pos      = my_seg_base + fixup.m_PointerOffset;
    int64_t  dest_pos        = target_seg_base + fixup.m_Target.m_Offset;

    int64_t  delta           = dest_pos - source_pos;
    int32_t  delta32         = int32_t(delta);

    uint8_t *ptr_loc         = self->m_Bytes.m_Storage + fixup.m_PointerOffset;

    if (delta32 != delta)
      Croak("pointer relocation too big");

    memcpy(ptr_loc, &delta32, sizeof(int32_t));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x21770
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x21790
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x21347
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
addq 0x10(%rcx), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
subq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x38(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x68(%rbp)
movslq -0x5c(%rbp), %rax
cmpq -0x58(%rbp), %rax
je 0x2132d
leaq 0x43dd(%rip), %rdi      # 0x25703
movb $0x0, %al
callq 0x75a0
movq -0x68(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x28(%rbp)
jmp 0x212a2
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/IncludeScanner.cpp
// Function: t2::ScanIncludesCpp(char*, t2::MemAllocLinear*)
IncludeData*
ScanIncludesCpp(char* buffer, MemAllocLinear* allocator)
{
  IncludeDataList list;

  char *linep = buffer;

  while (linep)
  {
    char *line = linep;
    linep = GetNextLine(linep);

    if (IncludeData* d = ScanCppLine(line, allocator))
    {
      list.Add(d);
    }
  }

  return list.m_Head;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x21f90
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x21994
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x219a0
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x219f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x21992
movq -0x38(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x21fb0
jmp 0x21951
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/IncludeScanner.cpp
// Function: t2::GetNextLine(char*)
static char*
GetNextLine(char *p)
{
  if (char *lf = strchr(p, '\n'))
  {
    *lf = '\0';
    return lf + 1;
  }
  else
  {
    return nullptr;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x3130
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x219da
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x219e2
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/IncludeScanner.cpp
// Function: t2::ScanIncludesGeneric(char*, t2::MemAllocLinear*, t2::GenericScannerData const&)
IncludeData* ScanIncludesGeneric(char* buffer, MemAllocLinear* allocator, const GenericScannerData& config)
{
  char* linep = buffer;
  IncludeDataList includes;

  while (linep)
  {
    char *line_data = linep;
    linep = GetNextLine(linep);

    if (IncludeData* d = ScanLineGeneric(allocator, line_data, config))
    {
      includes.Add(d);
    }
  }

  return includes.m_Head;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x21f90
cmpq $0x0, -0x20(%rbp)
je 0x21c4c
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x219a0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x21c60
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x21c4a
movq -0x40(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x21fb0
jmp 0x21c05
movq -0x30(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/IncludeScanner.cpp
// Function: t2::IncludeDataList::Add(t2::IncludeData*)
void Add(IncludeData* d)
  {
    if (!m_Head)
    {
      m_Head = d;
      m_Curr = d;
    }
    else
    {
      m_Curr->m_Next = d;
      m_Curr = d;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, (%rax)
jne 0x21fdf
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x21ff7
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, 0x18(%rcx)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
popq %rbp
retq
nopl (%rax)