// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverCheckDagSignatures(t2::Driver*)
static bool DriverCheckDagSignatures(Driver* self)
{
  const DagData* dag_data = self->m_DagData;

#if ENABLED(CHECKED_BUILD)
    // Paranoia - make sure the data is sorted.
    for (int i = 1, count = dag_data->m_NodeCount; i < count; ++i)
    {
      if (dag_data->m_NodeGuids[i] < dag_data->m_NodeGuids[i - 1])
        Croak("DAG data is not sorted by guid");
    }
#endif

  Log(kDebug, "checking file signatures for DAG data");

  if (dag_data->m_Passes.GetCount() > Driver::kMaxPasses)
  {
    Log(kError, "too many passes, max is %d", Driver::kMaxPasses);
    return false;
  }

  // Check timestamps of lua files used to produce the DAG
  for (const DagFileSignature& sig : dag_data->m_FileSignatures)
  {
    const char* path = sig.m_Path;

    uint64_t timestamp = sig.m_Timestamp;
    FileInfo info      = GetFileInfo(path);

    if (info.m_Timestamp != timestamp)
    {
      Log(kInfo, "DAG out of date: timestamp change for %s", path);
      return false;
    }
  }

  // Check directory listing fingerprints
  // Note that the digest computation in here must match the one in LuaListDirectory
  // The digests computed there are stored in the signature block by Lua code.
  for (const DagGlobSignature& sig : dag_data->m_GlobSignatures)
  {
    HashDigest digest = CalculateGlobSignatureFor(sig.m_Path, &self->m_Heap, &self->m_Allocator);

    // Compare digest with the one stored in the signature block
    if (0 != memcmp(&digest, &sig.m_Digest, sizeof digest))
    {
      char stored[kDigestStringSize], actual[kDigestStringSize];
      DigestToString(stored, sig.m_Digest);
      DigestToString(actual, digest);
      Log(kInfo, "DAG out of date: file glob change for %s (%s => %s)", sig.m_Path.Get(), stored, actual);
      return false;
    }
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x8, %edi
leaq 0x145c4(%rip), %rsi     # 0x248de
movb $0x0, %al
callq 0x7a60
movq -0x18(%rbp), %rdi
addq $0x10, %rdi
callq 0x14860
cmpl $0x40, %eax
jle 0x10354
movl $0x1, %edi
leaq 0x145c5(%rip), %rsi     # 0x24904
movl $0x40, %edx
movb $0x0, %al
callq 0x7a60
movb $0x0, -0x1(%rbp)
jmp 0x104e5
movq -0x18(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14ab0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x14ad0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
je 0x103ec
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x6e20
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x16920
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
je 0x103dc
movq -0x40(%rbp), %rdx
movl $0x4, %edi
leaq 0x14553(%rip), %rsi     # 0x2491f
movb $0x0, %al
callq 0x7a60
movb $0x0, -0x1(%rbp)
jmp 0x104e5
jmp 0x103de
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
jmp 0x1037a
movq -0x18(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x14b10
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0x14b30
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rax
cmpq -0x78(%rbp), %rax
je 0x104e1
movq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x6e20
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
callq 0x20390
movq %rax, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
movq -0x80(%rbp), %rsi
addq $0x4, %rsi
leaq -0x90(%rbp), %rdi
movl $0x10, %edx
callq 0x3160
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x104ce
movq -0x80(%rbp), %rsi
addq $0x4, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x171b0
leaq -0xf0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x171b0
movq -0x80(%rbp), %rdi
callq 0x6c00
movq %rax, %rdx
leaq -0xc0(%rbp), %rcx
leaq -0xf0(%rbp), %r8
movl $0x4, %edi
leaq 0x14487(%rip), %rsi     # 0x24948
movb $0x0, %al
callq 0x7a60
movb $0x0, -0x1(%rbp)
jmp 0x104e5
jmp 0x104d0
movq -0x70(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x70(%rbp)
jmp 0x10412
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)