LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/Hash.hpp
// Function: t2::SortRecordsByHash(t2::ScanCache::Record const*, t2::ScanCache::Record const*)
inline int CompareHashDigests(const HashDigest& lhs, const HashDigest& rhs)
{
  const uint64_t l0 = lhs.m_Words64[0];
  const uint64_t r0 = rhs.m_Words64[0];

  const int res0 = (l0 > r0) - (l0 < r0);

  const uint64_t l1 = lhs.m_Words64[1];
  const uint64_t r1 = rhs.m_Words64[1];

  const int res1 = (l1 > r1) - (l1 < r1);

  return res0 ? res0 : res1;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
xorl %eax, %eax
cmpq 0x8(%rsi), %rdx
setb %al
xorl %edx, %edx
cmpq (%rsi), %rcx
seta %dl
sbbl $0x0, %edx
sets %cl
movzbl %cl, %ecx
cmovnel %ecx, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl %ecx, %esi
movq %r8, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x10b48
cltq
shlq $0x4, %rax
addq 0x28(%r12), %rax
jmp 0x10b4a
xorl %eax, %eax
testq %rax, %rax
je 0x10b6b
movl (%rax), %esi
movq 0x8(%rax), %rdx
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13ba1
movq %r14, %rdi
callq 0x13bed
movl %eax, %r13d
movq %r14, (%rsp)
movq %rdx, %r14
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x110ca
movq 0x28(%r12), %rcx
cltq
shlq $0x4, %rax
movl %r13d, (%rcx,%rax)
movq %r14, 0x8(%rcx,%rax)
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x13ba1
movq %rbx, %rdi
callq 0x3150
leaq 0x1(%rax), %rdx
movq (%rsp), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x13b75
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
leaq 0xbbe5(%rip), %rdi      # 0x1d6a8
callq 0x34b0
testl %eax, %eax
jne 0x11afa
movq %rbx, 0xbbfd(%rip)      # 0x1d6d0
movq 0xbbfe(%rip), %rdi      # 0x1d6d8
testq %rdi, %rdi
je 0x11ae8
callq 0x3110
testl %eax, %eax
jne 0x11b0c
leaq 0xbbb9(%rip), %rdi      # 0x1d6a8
callq 0x3250
testl %eax, %eax
jne 0x11b03
popq %rbx
retq
leaq 0x3f73(%rip), %rdi      # 0x15a74
jmp 0x11b13
leaq 0x3f86(%rip), %rdi      # 0x15a90
jmp 0x11b13
leaq 0x3f9b(%rip), %rdi      # 0x15aae
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %rax
leaq 0xbb86(%rip), %rdi      # 0x1d6a8
xorl %esi, %esi
callq 0x34d0
testl %eax, %eax
jne 0x11b4f
leaq 0x32(%rip), %rdx        # 0x11b66
movq %rsp, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x3610
testl %eax, %eax
jne 0x11b58
movq (%rsp), %rdi
callq 0x3230
popq %rax
retq
leaq 0x3ed2(%rip), %rdi      # 0x15a28
jmp 0x11b5f
leaq 0x55f8(%rip), %rdi      # 0x17157
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
subq $0x90, %rsp
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3420
movq %rbx, %rdi
movl $0x2, %esi
callq 0x3530
movq %rbx, %rdi
movl $0xf, %esi
callq 0x3530
movq %rbx, %rdi
movl $0x3, %esi
callq 0x3530
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x30e0
testl %eax, %eax
jne 0x11bf8
movl 0xc(%rsp), %eax
cmpl $0xf, %eax
je 0x11bd8
cmpl $0x3, %eax
je 0x11bcf
cmpl $0x2, %eax
jne 0x11be1
leaq 0x55ce(%rip), %rdi      # 0x1719b
jmp 0x11be8
leaq 0x55d4(%rip), %rdi      # 0x171aa
jmp 0x11be8
leaq 0x55c3(%rip), %rdi      # 0x171a2
jmp 0x11be8
leaq 0x55ab(%rip), %rdi      # 0x17193
callq 0x11ab8
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
leaq 0x55b3(%rip), %rdi      # 0x171b2
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %r14
pushq %rbx
subq $0x88, %rsp
movl %edi, %ebx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x3420
movq %r14, %rdi
movl $0x2, %esi
callq 0x3530
movq %r14, %rdi
movl $0xf, %esi
callq 0x3530
movq %r14, %rdi
movl $0x3, %esi
callq 0x3530
xorb $0x1, %bl
movzbl %bl, %edi
movq %r14, %rsi
xorl %edx, %edx
callq 0x30b0
testl %eax, %eax
jne 0x11ccc
addq $0x88, %rsp
popq %rbx
popq %r14
retq
leaq 0x54a9(%rip), %rdi      # 0x1717c
xorl %eax, %eax
callq 0x5c85
nop
// File: /workspace/github_c_makefile_star2_O1/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 %rax
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rdi)
movups %xmm0, 0x54(%rdi)
movq %rdx, 0x68(%rdi)
movq $0x0, 0x70(%rdi)
addq $0x10, %rdi
xorl %esi, %esi
callq 0x3260
testl %eax, %eax
jne 0x11d0c
popq %rax
retq
leaq 0x53ad(%rip), %rdi      # 0x170c0
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rdi), %rbx
movq %rbx, %rdi
callq 0x34f0
testl %eax, %eax
jne 0x11dad
leaq 0x48(%r14), %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x11d89
cltq
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x70(%r14), %rax
jmp 0x11d8b
xorl %eax, %eax
testq %rax, %rax
je 0x11d96
movl $0x40000000, (%rax)     # imm = 0x40000000
movq %rbx, %rdi
callq 0x3430
testl %eax, %eax
jne 0x11db6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5349(%rip), %rdi      # 0x170fd
jmp 0x11dbd
leaq 0x535f(%rip), %rdi      # 0x1711c
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsi), %r14
movq %r14, %rdi
callq 0x32f0
testl %eax, %eax
jne 0x11ef1
leaq 0x48(%r15), %r13
movq %r13, %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x11e17
cltq
leaq (%rax,%rax,2), %rax
shlq $0x3, %rax
addq 0x70(%r15), %rax
jmp 0x11e19
xorl %eax, %eax
testq %rax, %rax
je 0x11e37
testb $0x40, 0x3(%rax)
jne 0x11e37
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rbx)
movups (%rax), %xmm0
movups %xmm0, (%rbx)
jmp 0x11ed3
movq %r14, %rdi
callq 0x3430
testl %eax, %eax
jne 0x11efa
movq %r13, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
leaq 0xb749(%rip), %rax      # 0x1d5a0
lock
incl 0x74(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0xdd8c
movq %r14, %rdi
callq 0x34f0
testl %eax, %eax
jne 0x11ef1
movq (%r15), %rbp
movq %r12, %rdi
callq 0x3150
movq %rax, %r13
leaq 0x1(%rax), %rsi
movl $0x1, %edx
movq %rbp, %rdi
callq 0xf030
movq %rax, %rbp
movq %rax, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3290
movb $0x0, (%rbp,%r13)
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movq %rbp, %rdx
callq 0x11f46
movq 0x70(%r15), %rcx
cltq
leaq (%rax,%rax,2), %rax
movups (%rbx), %xmm0
movups %xmm0, (%rcx,%rax,8)
movq 0x10(%rbx), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
movq %r14, %rdi
callq 0x3430
testl %eax, %eax
jne 0x11efa
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5205(%rip), %rdi      # 0x170fd
jmp 0x11f01
leaq 0x521b(%rip), %rdi      # 0x1711c
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movl %edi, %ebx
movl $0x3, %esi
xorl %eax, %eax
callq 0x31e0
orl $0x800, %eax            # imm = 0x800
movl %ebx, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x31e0
cmpl $-0x1, %eax
je 0x12bbc
popq %rbx
retq
leaq 0x470c(%rip), %rdi      # 0x172cf
movl %ebx, %esi
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %esi, %esi
callq 0x3260
testl %eax, %eax
jne 0x12c56
xorl %r12d, %r12d
movq %r12, 0x38(%rbx)
leaq 0x40(%rbx), %r15
movq %r15, %rdi
callq 0xef60
leaq 0x48(%rbx), %rdi
shrq %r14
leaq 0x46e0(%rip), %rcx      # 0x172e6
movq %r15, %rsi
movq %r14, %rdx
callq 0xefb4
leaq 0x80(%rbx), %rdi
callq 0xf074
xorps %xmm0, %xmm0
movups %xmm0, 0xac(%rbx)
movups %xmm0, 0xa0(%rbx)
movq %r15, 0xc0(%rbx)
movq %r12, 0xc8(%rbx)
xorl %edi, %edi
callq 0x3300
movq %rax, 0xd0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x4463(%rip), %rdi      # 0x170c0
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/DigestCache.cpp
// Function: t2::DigestCacheOpen(t2::DigestCache*, char const*)
void DigestCacheOpen(DigestCache* self, const char* filename)
{
  MmapFileMap(&self->m_StateFile, filename);
  if (MmapFileValid(&self->m_StateFile))
  {
    const DigestCacheState* state = (const DigestCacheState*) self->m_StateFile.m_Address;
    if (DigestCacheState::MagicNumber == state->m_MagicNumber)
    {
      const uint64_t time_now = time(nullptr);

      // Throw out records that haven't been accessed in a week.
      const uint64_t cutoff_time = time_now - 7 * 24 * 60 * 60;

      self->m_State = state;

      //HashTablePrepareBulkInsert(&self->m_Table, state->m_Records.GetCount());

      for (const FrozenDigestRecord& record : state->m_Records)
      {
        if (record.m_AccessTime < cutoff_time)
          continue;

        DigestCacheRecord r;
        r.m_ContentDigest = record.m_ContentDigest;
        r.m_Timestamp     = record.m_Timestamp;
        r.m_AccessTime    = record.m_AccessTime;
        HashTableInsert(&self->m_Table, record.m_FilenameHash, record.m_Filename.Get(), r);
      }
      Log(kDebug, "digest cache initialized -- %d entries", state->m_Records.GetCount());
    }
    else
    {
      MmapFileUnmap(&self->m_StateFile);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leaq 0x80(%rdi), %r14
movq %r14, %rdi
callq 0xf11b
movq %rbx, (%rsp)
movq 0x80(%rbx), %rbx
testq %rbx, %rbx
je 0x12d9a
cmpl $0x6a683db8, (%rbx)     # imm = 0x6A683DB8
jne 0x12da9
xorl %edi, %edi
callq 0x3300
movq %rax, %r14
movq (%rsp), %rax
movq %rbx, 0x38(%rax)
movslq 0x8(%rbx), %rax
testq %rax, %rax
leaq 0x8(%rax,%rbx), %r13
cmoveq %rax, %r13
movq %rbx, 0x8(%rsp)
movslq 0x4(%rbx), %rax
testq %rax, %rax
je 0x12d71
addq $-0x93a80, %r14         # imm = 0xFFF6C580
movq (%rsp), %rcx
addq $0xa0, %rcx
movq %rcx, 0x18(%rsp)
leaq 0x24(%r13), %rcx
movq %rcx, 0x10(%rsp)
shlq $0x4, %rax
leaq (%rax,%rax,2), %r12
xorl %r15d, %r15d
movq 0x8(%r13,%r15), %rbp
cmpq %r14, %rbp
jb 0x12d68
movups 0x14(%r13,%r15), %xmm0
movaps %xmm0, 0x20(%rsp)
movq (%r13,%r15), %rbx
movl 0x10(%r13,%r15), %esi
movslq 0x24(%r13,%r15), %rax
movq 0x10(%rsp), %rcx
leaq (%rcx,%r15), %rdx
addq %rax, %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movq 0x18(%rsp), %rdi
callq 0x132a5
movq (%rsp), %rcx
movq 0xc8(%rcx), %rcx
cltq
shlq $0x5, %rax
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rcx,%rax)
movq %rbx, 0x10(%rcx,%rax)
movq %rbp, 0x18(%rcx,%rax)
addq $0x30, %r15
cmpq %r15, %r12
jne 0x12d03
movq 0x8(%rsp), %rax
movl 0x4(%rax), %edx
leaq 0x4577(%rip), %rsi      # 0x172f7
movl $0x8, %edi
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5ef0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf084
// File: /workspace/github_c_makefile_star2_O1/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 %rbx
movq %rdi, %rbx
addq $0xa0, %rdi
callq 0x13267
leaq 0x80(%rbx), %rdi
callq 0xf07f
leaq 0x48(%rbx), %rdi
callq 0xf012
leaq 0x40(%rbx), %rdi
callq 0xef61
movq %rbx, %rdi
callq 0x35c0
testl %eax, %eax
jne 0x12dfb
popq %rbx
retq
leaq 0x42db(%rip), %rdi      # 0x170dd
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
callq 0x32f0
testl %eax, %eax
jne 0x13123
leaq 0xa0(%rbx), %rdi
movl %ebp, %esi
movq %r12, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x130e6
cltq
shlq $0x5, %rax
addq 0xc8(%rbx), %rax
jmp 0x130e8
xorl %eax, %eax
testq %rax, %rax
je 0x1310a
cmpq %r15, 0x10(%rax)
jne 0x1310a
movq 0xd0(%rbx), %rcx
movq %rcx, 0x18(%rax)
movups (%rax), %xmm0
movups %xmm0, (%r14)
movb $0x1, %bpl
jmp 0x1310c
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x3430
testl %eax, %eax
jne 0x1312c
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3fd3(%rip), %rdi      # 0x170fd
jmp 0x13133
leaq 0x3fe9(%rip), %rdi      # 0x1711c
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r13
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x34f0
testl %eax, %eax
jne 0x13250
leaq 0xa0(%rbx), %r12
movq %r12, %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x8c89
cmpl $-0x1, %eax
je 0x1318b
cltq
shlq $0x5, %rax
addq 0xc8(%rbx), %rax
jmp 0x1318d
xorl %eax, %eax
testq %rax, %rax
je 0x131ae
movq %r14, 0x10(%rax)
movups (%r13), %xmm0
movups %xmm0, (%rax)
movq 0xd0(%rbx), %rcx
movq %rcx, 0x18(%rax)
jmp 0x13235
movups (%r13), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0xd0(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x48(%rbx), %r13
movq %r15, %rdi
callq 0x3150
movq %r14, (%rsp)
movq %rax, %r14
leaq 0x1(%rax), %rsi
movl $0x1, %edx
movq %r13, %rdi
callq 0xf030
movq %rax, %r13
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x3290
movb $0x0, (%r13,%r14)
movq %r12, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x132a5
movq 0xc8(%rbx), %rcx
cltq
shlq $0x5, %rax
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rcx,%rax)
movq (%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax)
movq 0x8(%rsp), %rdx
movq %rdx, 0x18(%rcx,%rax)
movq %rbx, %rdi
callq 0x3430
testl %eax, %eax
jne 0x13259
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ea6(%rip), %rdi      # 0x170fd
jmp 0x13260
leaq 0x3ebc(%rip), %rdi      # 0x1711c
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r12
movq %rdx, %rdi
callq 0x3150
movq %rax, %r13
leaq 0x1(%rax), %rsi
movl $0x1, %edx
movq %r12, %rdi
callq 0xf030
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3290
movb $0x0, (%r12,%r13)
leaq 0x10(%rbx), %rax
testb $0x8, (%r15)
leaq 0x28(%rbx), %rdi
cmovneq %rax, %rdi
movq 0x8(%rbx), %rsi
movl $0x1, %edx
callq 0x12604
movq %r12, (%rax)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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:
xorl %eax, %eax
leaq 0x38bf(%rip), %rcx      # 0x17350
movl (%rax,%rcx), %edx
leal 0x24234428(%rdx), %esi
movl %esi, (%rdi,%rax,4)
leal -0x7a143589(%rdx), %esi
movl %esi, 0x4(%rdi,%rax,4)
movl %edx, 0x8(%rdi,%rax,4)
addl $0x61c8864f, %edx       # imm = 0x61C8864F
movl %edx, 0xc(%rdi,%rax,4)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x13a91
retq
// File: /workspace/github_c_makefile_star2_O1/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:
xorl %eax, %eax
movl (%rdi,%rax,4), %ecx
movl 0x4(%rdi,%rax,4), %edx
movl 0x8(%rdi,%rax,4), %r8d
roll %ecx
movl 0xc(%rdi,%rax,4), %r9d
roll $0x7, %edx
addl %ecx, %edx
roll $0xc, %r8d
roll $0x12, %r9d
addl %r8d, %r9d
addl %edx, %r9d
movl %r9d, %ecx
shrl $0xf, %ecx
xorl %r9d, %ecx
imull $0x85ebca77, %ecx, %ecx # imm = 0x85EBCA77
movl %ecx, %edx
shrl $0xd, %edx
xorl %ecx, %edx
imull $0xc2b2ae3d, %edx, %ecx # imm = 0xC2B2AE3D
movl %ecx, %edx
shrl $0x10, %edx
xorl %ecx, %edx
movl %edx, (%rsi,%rax)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x13ac2
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %rbx
movq 0x20(%rdi), %r15
leaq (%rsi,%r15), %rax
decq %rax
negq %rsi
andq %rax, %rsi
cmpq %r15, %rsi
je 0x13b5f
movq %rdi, %rbx
leaq 0x18(%rdi), %r14
subq %rsi, %r15
movq 0x10(%rbx), %rsi
movl $0x1, %edx
movq %r14, %rdi
callq 0x13e97
movb $-0x2, (%rax)
incq %r15
jne 0x13b46
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
addq $0x30, %rdi
movq 0x10(%r14), %rsi
movl $0x1, %edx
callq 0x13ef8
movq 0x20(%r14), %rcx
movq %rcx, (%rax)
movl %ebp, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq 0x10(%r14), %rsi
addq $0x18, %r14
movl $0x4, %edx
movq %r14, %rdi
callq 0x13e97
movl $0x7eeeeeee, (%rax)     # imm = 0x7EEEEEEE
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %rax
movq %rax, (%rsp)
movq 0x10(%rdi), %r12
testq %r12, %r12
je 0x13c93
movq 0x8(%rbx), %r13
shlq $0x3, %r12
xorl %ebp, %ebp
movq (%r13,%rbp), %r14
movq 0x30(%r14), %rsi
testq %rsi, %rsi
je 0x13c5a
leaq 0x30(%r14), %r15
movq 0x10(%r14), %rdi
callq 0xef6a
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq 0x18(%r14), %rsi
testq %rsi, %rsi
je 0x13c7f
leaq 0x18(%r14), %r15
movq 0x10(%r14), %rdi
callq 0xef6a
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0xef6a
addq $0x8, %rbp
cmpq %rbp, %r12
jne 0x13c30
movq (%rsp), %r14
movq (%r14), %rsi
testq %rsi, %rsi
je 0x13cb6
movq (%rbx), %rdi
callq 0xef6a
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %r15
testq %r15, %r15
je 0x13d80
movq 0x8(%rbx), %r12
xorl %r13d, %r13d
movq (%r12,%r13,8), %rdi
movl $0x10, %esi
callq 0x13b21
incq %r13
cmpq %r13, %r15
jne 0x13cef
xorl %eax, %eax
xorl %ecx, %ecx
movq (%r12,%rax,8), %rdx
movq %rcx, 0x8(%rdx)
addq 0x20(%rdx), %rcx
incq %rax
cmpq %rax, %r15
jne 0x13d09
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
movq 0x38(%rcx), %rdi
testq %rdi, %rdi
je 0x13d78
movq 0x30(%rcx), %rdx
movq 0x8(%rcx), %rsi
shlq $0x3, %rdi
leaq (%rdi,%rdi,2), %rdi
xorl %r8d, %r8d
movslq 0x8(%rdx,%r8), %r9
movq (%r12,%r9,8), %r9
movq 0x8(%r9), %r9
movq (%rdx,%r8), %r10
subq %rsi, %r9
subq %r10, %r9
addq 0x10(%rdx,%r8), %r9
movslq %r9d, %r11
cmpq %r9, %r11
jne 0x13df7
movq 0x18(%rcx), %r11
movl %r9d, (%r11,%r10)
addq $0x18, %r8
cmpq %r8, %rdi
jne 0x13d3f
incq %rax
cmpq %r15, %rax
jne 0x13d1f
leaq 0x35d9(%rip), %rsi      # 0x17360
movq %r14, %rdi
callq 0x33c0
testq %rax, %rax
je 0x13ddd
movq %rax, %r14
movq 0x10(%rbx), %r15
testq %r15, %r15
je 0x13de1
movq 0x8(%rbx), %r12
movl $0x1, %r13d
movq -0x8(%r12,%r13,8), %rax
movq 0x18(%rax), %rdi
movq 0x20(%rax), %rbx
movl $0x1, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x3650
cmpq %rax, %rbx
sete %bl
jne 0x13de3
leaq 0x1(%r13), %rax
cmpq %r15, %r13
movq %rax, %r13
jb 0x13daa
jmp 0x13de3
xorl %ebx, %ebx
jmp 0x13deb
movb $0x1, %bl
movq %r14, %rdi
callq 0x3340
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x3565(%rip), %rdi      # 0x17363
xorl %eax, %eax
callq 0x5bdd
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl $0x48, %esi
callq 0xef62
movq %rax, %rbx
leaq 0x8(%r14), %r15
movl 0x10(%r14), %eax
movq (%r14), %r12
movl %eax, (%rbx)
movq $-0x1, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movl $0x20000, %esi          # imm = 0x20000
movq %r12, %rdi
callq 0xef62
movq %rax, 0x18(%rbx)
xorl %r13d, %r13d
movq %r13, 0x20(%rbx)
movq $0x20000, 0x28(%rbx)    # imm = 0x20000
movl $0x18000, %esi          # imm = 0x18000
movq %r12, %rdi
callq 0xef62
movq %rax, 0x30(%rbx)
movq %r13, 0x38(%rbx)
movq $0x1000, 0x40(%rbx)     # imm = 0x1000
movq (%r14), %rsi
movl $0x1, %edx
movq %r15, %rdi
callq 0x13f67
movq %rbx, (%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, 0x8(%rsp)
testq %rdi, %rdi
je 0x14185
movq %rdi, %r15
xorl %ebp, %ebp
movq $0x0, (%rsp)
movq %r15, %rbx
movq %r15, %rdi
movl $0xa, %esi
callq 0x3130
testq %rax, %rax
movq %rbp, 0x10(%rsp)
je 0x1401e
movq %rax, %r15
movb $0x0, (%rax)
incq %r15
jmp 0x14021
xorl %r15d, %r15d
leaq -0x1(%rbx), %rbp
leaq 0x8(%rbx), %rcx
addq $0xa, %rbx
movq %rcx, %r13
movq %rbx, %r14
movb 0x1(%rbp), %r12b
incq %rbp
movsbl %r12b, %edi
callq 0x3070
leaq 0x1(%r13), %rcx
incq %rbx
testl %eax, %eax
jne 0x1402d
cmpb $0x23, %r12b
jne 0x14087
movl $0x9, %r12d
movsbl -0x7(%r13), %edi
callq 0x3070
incq %r13
incq %r14
testl %eax, %eax
jne 0x1405a
leaq -0x8(%r13), %rsi
movl $0x7, %edx
leaq 0x3300(%rip), %rdi      # 0x1737e
callq 0x3170
testl %eax, %eax
je 0x140b9
xorl %ebp, %ebp
testq %rbp, %rbp
je 0x140a0
cmpq $0x0, (%rsp)
je 0x140a7
movq 0x10(%rsp), %rax
movq %rbp, 0x18(%rax)
jmp 0x140ab
movq 0x10(%rsp), %rbp
jmp 0x140ab
movq %rbp, (%rsp)
testq %r15, %r15
jne 0x13ff9
jmp 0x1418d
movsbl -0x1(%r13), %edi
callq 0x3070
testl %eax, %eax
je 0x14087
movsbl (%r13), %edi
callq 0x3070
incq %r13
testl %eax, %eax
jne 0x140c7
movl $0x20, %esi
movl $0x8, %edx
movq 0x8(%rsp), %rdi
callq 0xf030
movq %rax, %rbp
movzbl -0x1(%r13), %eax
cmpl $0x3c, %eax
je 0x14107
cmpl $0x22, %eax
jne 0x14087
movl $0x22, %eax
xorl %edi, %edi
jmp 0x1410f
movl $0x3e, %eax
movb $0x1, %dil
movq $-0x1, %rbx
movq %r13, %rcx
movsbl (%rcx), %esi
incq %rcx
xorl %edx, %edx
testl %esi, %esi
sete %dl
cmpl %esi, %eax
cmovel %r12d, %edx
incq %rbx
testl %edx, %edx
je 0x14119
cmpl $0x9, %edx
jne 0x14087
movq %rbx, 0x8(%rbp)
leaq 0x1(%rbx), %rsi
movl $0x1, %edx
movl %edi, %r12d
movq 0x8(%rsp), %rdi
callq 0xf030
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3290
movb $0x0, (%r14,%rbx)
movq %r14, (%rbp)
movb %r12b, 0x10(%rbp)
movb $0x1, 0x11(%rbp)
movq $0x0, 0x18(%rbp)
jmp 0x14089
movq $0x0, (%rsp)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/TerminalIo.cpp
// Function: t2::TerminalIoInit()
void TerminalIoInit(void)
{
	int i;
	for (i = 0; i < kLineBufCount; ++i)
	{
		s_FreeLinebufs[i] = &s_Linebufs[i];
		s_Linebufs[i].m_Data = &s_BufferData[i][0];
		s_Linebufs[i].m_Data = &s_BufferData[i][0];
	}
	s_FreeLinebufCount = kLineBufCount;
	s_QueuedLinebufCount = 0;


  MutexInit(&s_LineLock);
  CondInit(&s_CanPrint);
}

// Assembly:
pushq %rax
leaq 0x9a50(%rip), %rax      # 0x1dee0
leaq 0x9249(%rip), %rcx      # 0x1d6e0
xorl %edx, %edx
leaq 0x9840(%rip), %rsi      # 0x1dce0
movq %rcx, (%rdx,%rsi)
movq %rax, 0x10(%rcx)
addq $0x2000, %rax           # imm = 0x2000
addq $0x8, %rdx
addq $0x18, %rcx
cmpq $0x200, %rdx            # imm = 0x200
jne 0x144a0
movl $0x40, 0x89a17(%rip)    # 0x9dee0
movl $0x0, 0x89a11(%rip)     # 0x9dee4
leaq 0x89a0e(%rip), %rdi     # 0x9dee8
xorl %esi, %esi
callq 0x34d0
testl %eax, %eax
jne 0x144f9
leaq 0x89a24(%rip), %rdi     # 0x9df10
xorl %esi, %esi
callq 0x33e0
testl %eax, %eax
jne 0x14502
popq %rax
retq
leaq 0x1528(%rip), %rdi      # 0x15a28
jmp 0x14509
leaq 0x153b(%rip), %rdi      # 0x15a44
xorl %eax, %eax
callq 0x5c85
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/TerminalIo.cpp
// Function: t2::TerminalIoJobExit(int)
void TerminalIoJobExit(int job_id)
{
	/* Find any queued buffers for this job and flush them. */
	MutexLock(&s_LineLock);

	TTY_PRINTF(("exit job %d\n", job_id));

	if (job_id != s_PrintingJobIndex) {
		/* Wait until we can grab the TTY */
		while (-1 != s_PrintingJobIndex) {
			CondWait(&s_CanPrint, &s_LineLock);
		}
	}

	s_PrintingJobIndex = job_id;

	FlushOutputQueue(job_id);

	s_PrintingJobIndex = -1;

	MutexUnlock(&s_LineLock);

	CondBroadcast(&s_CanPrint);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0x8962c(%rip), %rdi     # 0x9dee8
callq 0x34b0
testl %eax, %eax
jne 0x1494f
movl 0x8aa9(%rip), %eax      # 0x1d378
cmpl %ebx, %eax
sete %cl
cmpl $-0x1, %eax
sete %al
orb %cl, %al
jne 0x14904
leaq 0x8962b(%rip), %r14     # 0x9df10
leaq 0x895fc(%rip), %r15     # 0x9dee8
movq %r14, %rdi
movq %r15, %rsi
callq 0x3520
testl %eax, %eax
jne 0x14941
cmpl $-0x1, 0x8a76(%rip)     # 0x1d378
jne 0x148ec
movl %ebx, 0x8a6e(%rip)      # 0x1d378
movl %ebx, %edi
callq 0x1477d
movl $0xffffffff, 0x8a5d(%rip) # imm = 0xFFFFFFFF
leaq 0x895c6(%rip), %rdi     # 0x9dee8
callq 0x3250
testl %eax, %eax
jne 0x14958
leaq 0x895de(%rip), %rdi     # 0x9df10
callq 0x3110
testl %eax, %eax
jne 0x14961
popq %rbx
popq %r14
popq %r15
retq
leaq 0x144d(%rip), %rdi      # 0x15d95
xorl %eax, %eax
callq 0x5c85
leaq 0x111e(%rip), %rdi      # 0x15a74
jmp 0x14948
leaq 0x1131(%rip), %rdi      # 0x15a90
jmp 0x14948
leaq 0x1146(%rip), %rdi      # 0x15aae
jmp 0x14948
// File: /workspace/github_c_makefile_star2_O1/deplinenoise[P]tundra/src/TerminalIo.cpp
// Function: t2::TerminalIoPrintf(int, int, char const*, ...)
void TerminalIoPrintf(int job_id, int sort_key, const char *format, ...)
{
	char buffer[16384];
	va_list a;
	va_start(a, format);
	vsnprintf(buffer, sizeof(buffer), format, a);
	buffer[sizeof(buffer)-1] = '\0';
	TerminalIoEmit(job_id, 0, sort_key, buffer, (int) strlen(buffer));
	va_end(a);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40d0, %rsp           # imm = 0x40D0
movl %esi, %ebx
movl %edi, %ebp
leaq 0x20(%rsp), %rsi
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x149c5
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x40f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x4000, %esi           # imm = 0x4000
movq %r14, %rdi
callq 0x3200
movb $0x0, 0x3fff(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebp, %edi
xorl %esi, %esi
movl %ebx, %edx
movq %r14, %rcx
movl %eax, %r8d
callq 0x1454a
addq $0x40d0, %rsp           # imm = 0x40D0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/main.c
// Function: renderMainUsage
int renderMainUsage() {
	fprintf(stderr, "\n");
	fprintf(stderr, "Program: PALADIN (Protein Alignment and Detection Interface)\n\n");
	fprintf(stderr, "Usage:   paladin <command> [options]\n\n");
	fprintf(stderr, "Command: index         index NT or AA sequences in FASTA format\n");
	fprintf(stderr, "         prepare       download and index protein reference\n");
	fprintf(stderr, "         align         align single end read sequences\n");
	fprintf(stderr, "\n");
	fprintf(stderr, "         shm           manage indices in shared memory\n");
	fprintf(stderr, "         fa2pac        convert FASTA to PAC format\n");
	fprintf(stderr, "         pac2bwt       generate BWT from PAC\n");
	fprintf(stderr, "         bwtupdate     update .bwt to the new format\n");
	fprintf(stderr, "         bwt2sa        generate SA from BWT and Occ\n\n");
	fprintf(stderr, "         version       version and contact information\n");
	fprintf(stderr, "\n");
	fprintf(stderr,
"Note: To use PALADIN, first index the reference using the 'index' or 'prepare' command.\n"
"      Then align your reads using the 'align' command.\n\n");

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x2bf4b(%rip), %r12     # 0x2ffd0
movq (%r12), %rsi
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x23b0c(%rip), %rdi     # 0x27baa
pushq $0x3e
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23b32(%rip), %rdi     # 0x27be9
pushq $0x26
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23b43(%rip), %rdi     # 0x27c10
pushq $0x40
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23b6e(%rip), %rdi     # 0x27c51
pushq $0x3c
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23b95(%rip), %rdi     # 0x27c8e
pushq $0x37
popq %r14
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rsi
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x23ba8(%rip), %rdi     # 0x27cc6
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23bca(%rip), %rdi     # 0x27cfe
pushq $0x33
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23be8(%rip), %rdi     # 0x27d32
pushq $0x2d
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23c00(%rip), %rdi     # 0x27d60
pushq $0x35
popq %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23c1c(%rip), %rdi     # 0x27d96
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rcx
leaq 0x23c3c(%rip), %rdi     # 0x27dcc
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r12), %rsi
movl %ebp, %edi
callq 0x3410
movq (%r12), %rcx
leaq 0x23c53(%rip), %rdi     # 0x27e04
movl $0x90, %esi
movq %rbx, %rdx
callq 0x3790
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/main.c
// Function: renderVersion
int renderVersion() {
	fprintf(stderr, "\n");
	fprintf(stderr, "Program: PALADIN (Protein Alignment and Detection Interface)\n");

	fprintf(stderr, "Version: %s\n", PACKAGE_VERSION);
	fprintf(stderr, "Contact: Toni Westbrook (UNH) <anthony.westbrook@unh.edu>\n");
	fprintf(stderr, "Based on: BWA by Heng Li <lh3@sanger.ac.uk>\n\n");

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x2bdfb(%rip), %r14     # 0x2ffd0
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x3410
movq (%r14), %rcx
leaq 0x23cab(%rip), %rdi     # 0x27e95
pushq $0x3d
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3790
movq (%r14), %rdi
leaq 0x23967(%rip), %rsi     # 0x27b69
leaq 0x20e42(%rip), %rdx     # 0x2504b
xorl %eax, %eax
callq 0x3500
movq (%r14), %rcx
leaq 0x23cb9(%rip), %rdi     # 0x27ed3
pushq $0x3a
popq %rsi
movq %rbx, %rdx
callq 0x3790
movq (%r14), %rcx
leaq 0x23cdf(%rip), %rdi     # 0x27f0e
pushq $0x2d
popq %rsi
movq %rbx, %rdx
callq 0x3790
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/is.c
// Function: is_sa
int64_t is_sa(const ubyte_t *T, int64_t *SA, int64_t n)
{
	if ((T == NULL) || (SA == NULL) || (n < 0)) return -1;
	SA[0] = n;
	if (n <= 1) {
		if (n == 1) SA[1] = 0;
		return 0;
	}
	return sais_main(T, SA+1, 0, n, 256, 1);
}

// Assembly:
movq %rdx, %rcx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
testq %rcx, %rcx
sets %al
orb %dl, %al
movq $-0x1, %rax
jne 0x4e03
movq %rcx, (%rsi)
cmpq $0x1, %rcx
jg 0x4e04
jne 0x4e01
movq $0x0, 0x8(%rsi)
xorl %eax, %eax
retq
addq $0x8, %rsi
movl $0x100, %r8d            # imm = 0x100
movl $0x1, %r9d
xorl %edx, %edx
jmp 0x4e18
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/is.c
// Function: is_bwt
int64_t is_bwt(ubyte_t *T, int64_t n)
{
	int64_t *SA, i, primary = 0;
	SA = (int64_t *)calloc(n+1, sizeof(int64_t));

	if (is_sa(T, SA, n)) return -1;

	for (i = 0; i <= n; ++i) {
		if (SA[i] == 0) primary = i;
		else SA[i] = T[SA[i] - 1];
	}
	for (i = 0; i < primary; ++i) T[i] = SA[i];
	for (; i < n; ++i) T[i] = SA[i + 1];
	free(SA);
	return primary;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1(%rsi), %r13
leaq 0x1fb76(%rip), %rdx     # 0x25004
leaq 0x1fb74(%rip), %r8      # 0x25009
movl $0x8, %esi
movq %r13, %rdi
movl $0xd4, %ecx
callq 0x22cb4
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x4dcc
movq $-0x1, %r12
testq %rax, %rax
jne 0x5532
testq %rbx, %rbx
js 0x54f3
xorl %ecx, %ecx
xorl %eax, %eax
movq (%r15,%rax,8), %rdx
movq %rax, %r12
testq %rdx, %rdx
je 0x54e6
movzbl -0x1(%r14,%rdx), %edx
movq %rdx, (%r15,%rax,8)
movq %rcx, %r12
incq %rax
movq %r12, %rcx
cmpq %rax, %r13
jne 0x54cd
jmp 0x54f6
xorl %r12d, %r12d
xorl %eax, %eax
testq %r12, %r12
jle 0x5510
movb (%r15,%rax,8), %cl
movb %cl, (%r14,%rax)
incq %rax
cmpq %rax, %r12
jne 0x54fd
movq %r12, %rax
cmpq %rbx, %rax
jge 0x552a
movb 0x8(%r15,%rax,8), %cl
movb %cl, (%r14,%rax)
leaq 0x1(%rax), %rcx
movq %rcx, %rax
cmpq %rcx, %rbx
jne 0x5515
movq %r15, %rdi
callq 0x3390
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwtindex.c
// Function: writeIndexHeader
void writeIndexHeader(FILE * passFilePtr, IndexHeader passHeader) {
	fprintf(passFilePtr, ">VER=%s:NT=%d:MF=%d:RT=%d\n", PACKAGE_VERSION,
														passHeader.nucleotide,
														passHeader.multiFrame,
														passHeader.referenceType);
}

// Assembly:
movl 0x8(%rsp), %ecx
movl 0xc(%rsp), %r8d
movl 0x10(%rsp), %r9d
leaq 0x1f887(%rip), %rsi     # 0x25030
leaq 0x1f89b(%rip), %rdx     # 0x2504b
xorl %eax, %eax
jmp 0x3500
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwtindex.c
// Function: getIndexHeader
IndexHeader getIndexHeader(char * passFile) {
	FILE * filePtr;
	IndexHeader retHeader;

	// Open file and read header information
	filePtr = fopen(passFile, "r");

    if (filePtr == NULL) {
    	logMessage(__func__, LOG_LEVEL_ERROR, "Failed to open file '%s' : %s\n", passFile, errno ? strerror(errno) : "Out of memory");
    	exit(EXIT_FAILURE);
    }

	if (fscanf(filePtr, ">VER=%d.%d.%d:NT=%d:MF=%d:RT=%d", &(retHeader.version[0]),
														   &(retHeader.version[1]),
														   &(retHeader.version[2]),
														   &(retHeader.nucleotide),
														   &(retHeader.multiFrame),
														   &(retHeader.referenceType)) != 6) {
		logMessage(__func__, LOG_LEVEL_ERROR, "Failed to parse file '%s'\n", passFile);
    	exit(EXIT_FAILURE);
	}
	fclose(filePtr);

	return retHeader;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x21655(%rip), %rsi     # 0x26e1e
movq %rbx, %rdi
callq 0x3380
testq %rax, %rax
je 0x581f
movq %rax, %r15
leaq 0xc(%r14), %rdx
leaq 0x10(%r14), %rcx
leaq 0x14(%r14), %r8
leaq 0x4(%r14), %r10
leaq 0x8(%r14), %r11
leaq 0x1f899(%rip), %rsi     # 0x2508d
movq %rax, %rdi
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x3720
addq $0x10, %rsp
cmpl $0x6, %eax
jne 0x5833
movq %r15, %rdi
callq 0x32f0
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
callq 0x3050
movl (%rax), %edi
testl %edi, %edi
jne 0x5852
leaq 0x1f84e(%rip), %r8      # 0x2507f
jmp 0x585a
leaq 0x1f817(%rip), %rdi     # 0x25051
leaq 0x1f86c(%rip), %rdx     # 0x250ad
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xdbeb
jmp 0x5877
callq 0x30c0
movq %rax, %r8
leaq 0x1f7f0(%rip), %rdi     # 0x25051
leaq 0x1f7f8(%rip), %rdx     # 0x25060
movl $0x1, %esi
movq %rbx, %rcx
xorl %eax, %eax
callq 0xdbeb
movl $0x1, %edi
callq 0x33c0
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwtindex.c
// Function: getIndexCompatible
int getIndexCompatible(IndexHeader passHeader) {
	// Check if index newer than current version
	while (1) {
		if (passHeader.version[0] < PACKAGE_VERSION_MAJOR) break;
		if (passHeader.version[0] > PACKAGE_VERSION_MAJOR) return INDEX_COMPATBILITY_FUTURE;
		if (passHeader.version[1] < PACKAGE_VERSION_MINOR) break;
		if (passHeader.version[1] > PACKAGE_VERSION_MINOR) return INDEX_COMPATBILITY_FUTURE;
		if (passHeader.version[2] < PACKAGE_VERSION_REV) break;
		if (passHeader.version[2] > PACKAGE_VERSION_REV) return INDEX_COMPATBILITY_FUTURE;
		break;
	}

	// Check if reference new enough to be supported (1.1.0 for current version)
	while (1) {
		if (passHeader.version[0] < 1) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[0] > 1) break;
		if (passHeader.version[1] < 1) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[1] > 1) break;
		if (passHeader.version[2] < 0) return INDEX_COMPATIBILITY_NONE;
		if (passHeader.version[2] > 0) break;
		break;
	}

	return INDEX_COMPATIBLITY_FULL;
}

// Assembly:
movl 0x14(%rsp), %edx
testl %edx, %edx
jle 0x58a4
movl $0x2, %eax
cmpl $0x1, %edx
jne 0x58e5
leaq 0x8(%rsp), %rcx
movl 0x10(%rcx), %eax
cmpl $0x6, %eax
jge 0x58a7
testl %edx, %edx
jg 0x58c7
xorl %eax, %eax
retq
testl %edx, %edx
setle %dl
cmpl $0x6, %eax
setne %sil
cmpl $0x0, 0x14(%rcx)
setg %al
orb %sil, %al
orb %al, %dl
je 0x58c7
movzbl %al, %eax
addl %eax, %eax
retq
movl 0x10(%rcx), %edx
movl $0x0, %eax
testl %edx, %edx
jle 0x58e5
cmpl $0x1, %edx
setne %al
cmpl $0x0, 0x14(%rcx)
setns %cl
orb %al, %cl
movzbl %cl, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/ToniWestbrook[P]paladin/bwtindex.c
// Function: bwa_seq_len
int64_t bwa_seq_len(const char *fn_pac) {
	FILE *fp;
	int64_t pac_len;
	ubyte_t c;

	fp = xopen(fn_pac, "rb");
	err_fseek(fp, -1, SEEK_END);
	pac_len = err_ftell(fp);
	err_fread_noeof(&c, 1, 1, fp);
	err_fclose(fp);
	return pac_len - 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rsi
leaq 0x1f79f(%rip), %rdi     # 0x250c8
leaq 0x23078(%rip), %rdx     # 0x289a8
callq 0xdd8e
movq %rax, %rbx
movq %rax, %rdi
movq $-0x1, %rsi
movl $0x2, %edx
callq 0xe1c3
movq %rbx, %rdi
callq 0xe1ec
movq %rax, %r14
leaq 0x7(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0xe127
movq %rbx, %rdi
callq 0xe490
decq %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq