// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/BuildQueue.cpp
// Function: t2::CheckInputSignature(t2::BuildQueue*, t2::ThreadState*, t2::NodeState*, t2::Mutex*)
static BuildProgress::Enum CheckInputSignature(BuildQueue* queue, ThreadState* thread_state, NodeState* node, Mutex* queue_lock)
  {
    CHECK(AllDependenciesReady(queue, node));

    MutexUnlock(queue_lock);

    const BuildQueueConfig& config = queue->m_Config;
    StatCache* stat_cache = config.m_StatCache;
    DigestCache* digest_cache = config.m_DigestCache;

    const NodeData* node_data = node->m_MmapData;

    HashState sighash;
    FILE* debug_log = (FILE*) queue->m_Config.m_FileSigningLog;

    if (debug_log)
    {
      MutexLock(queue->m_Config.m_FileSigningLogMutex);
      fprintf(debug_log, "input_sig(\"%s\"):\n", node_data->m_Annotation.Get());
      HashInitDebug(&sighash, debug_log);
    }
    else
    {
      HashInit(&sighash);
    }

    // Start with command line action. If that changes, we'll definitely have to rebuild.
    HashAddString(&sighash, node_data->m_Action);
    HashAddSeparator(&sighash);

    if (const char* pre_action = node_data->m_PreAction)
    {
      HashAddString(&sighash, pre_action);
      HashAddSeparator(&sighash);
    }

    // Roll back scratch allocator after scanning only - filenames are being retained between scans
    MemAllocLinearScope alloc_scope(&thread_state->m_ScratchAlloc);

    const ScannerData* scanner = node_data->m_Scanner;

    for (const FrozenFileAndHash& input : node_data->m_InputFiles)
    {
      // Add path and timestamp of every direct input file.
      HashAddPath(&sighash, input.m_Filename);
      ComputeFileSignature(&sighash, stat_cache, digest_cache, input.m_Filename, input.m_FilenameHash, config.m_ShaDigestExtensions, config.m_ShaDigestExtensionCount);

      if (scanner)
      {
        ScanInput scan_input;
        scan_input.m_ScannerConfig = scanner;
        scan_input.m_ScratchAlloc  = &thread_state->m_ScratchAlloc;
        scan_input.m_ScratchHeap   = &thread_state->m_LocalHeap;
        scan_input.m_FileName      = input.m_Filename;
        scan_input.m_ScanCache     = queue->m_Config.m_ScanCache;

        ScanOutput scan_output;

        if (ScanImplicitDeps(stat_cache, &scan_input, &scan_output))
        {
          for (int i = 0, count = scan_output.m_IncludedFileCount; i < count; ++i)
          {
            // Add path and timestamp of every indirect input file (#includes)
            const FileAndHash& path = scan_output.m_IncludedFiles[i];
            HashAddPath(&sighash, path.m_Filename);
            ComputeFileSignature(&sighash, stat_cache, digest_cache, path.m_Filename, path.m_FilenameHash, config.m_ShaDigestExtensions, config.m_ShaDigestExtensionCount);
          }
        }
      }
    }

    HashFinalize(&sighash, &node->m_InputSignature);

    if (debug_log)
    {
      char sig[kDigestStringSize];
      DigestToString(sig, node->m_InputSignature);
      fprintf(debug_log, "  => %s\n", sig);
      MutexUnlock(queue->m_Config.m_FileSigningLogMutex);
    }

    // Figure out if we need to rebuild this node.
    const NodeStateData* prev_state = node->m_MmapState;

    BuildProgress::Enum next_state;

    if (!prev_state)
    {
      // This is a new node - we must built it
      Log(kSpam, "T=%d: building %s - new node", thread_state->m_ThreadIndex, node_data->m_Annotation.Get());
      next_state = BuildProgress::kRunAction;
    }
    else if (prev_state->m_InputSignature != node->m_InputSignature)
    {
      // The input signature has changed (either direct inputs or includes)
      // We need to rebuild this node.
      char oldDigest[kDigestStringSize];
      char newDigest[kDigestStringSize];
      DigestToString(oldDigest, prev_state->m_InputSignature);
      DigestToString(newDigest, node->m_InputSignature);

      Log(kSpam, "T=%d: building %s - input signature changed. was:%s now:%s", thread_state->m_ThreadIndex, node_data->m_Annotation.Get(), oldDigest, newDigest);
      next_state = BuildProgress::kRunAction;
    }
    else if (prev_state->m_BuildResult != 0)
    {
      // The build progress failed the last time around - we need to retry it.
      Log(kSpam, "T=%d: building %s - previous build failed", thread_state->m_ThreadIndex, node_data->m_Annotation.Get());
      next_state = BuildProgress::kRunAction;
    }
    else if (OutputFilesDiffer(node_data, prev_state))
    {
      // The output files are different - need to rebuild.
      Log(kSpam, "T=%d: building %s - output files have changed", thread_state->m_ThreadIndex, node_data->m_Annotation.Get());
      next_state = BuildProgress::kRunAction;
    }
    else if (OutputFilesMissing(stat_cache, node_data))
    {
      // One or more output files are missing - need to rebuild.
      Log(kSpam, "T=%d: building %s - output files are missing", thread_state->m_ThreadIndex, node_data->m_Annotation.Get());
      next_state = BuildProgress::kRunAction;
    }
    else
    {
      // Everything is up to date
      Log(kSpam, "T=%d: %s - up to date", thread_state->m_ThreadIndex, node_data->m_Annotation.Get());
      next_state = BuildProgress::kUpToDate;
    }

    MutexLock(queue_lock);

    return next_state;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
jmp 0x525d
movq -0x20(%rbp), %rdi
callq 0x69f0
movq -0x8(%rbp), %rax
addq $0x70, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x530a
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x69b0
movq -0xe8(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movq -0x218(%rbp), %rdi
movq %rax, %rdx
leaq 0x1e881(%rip), %rsi     # 0x23b6f
movb $0x0, %al
callq 0x3470
movq -0xe8(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x17160
jmp 0x5316
leaq -0xe0(%rbp), %rdi
callq 0x16f20
movq -0x40(%rbp), %rdi
callq 0x6e20
movq %rax, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x6de0
leaq -0xe0(%rbp), %rdi
callq 0x17130
movq -0x40(%rbp), %rdi
addq $0x4, %rdi
callq 0x6e20
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0x5377
movq -0xf0(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x6de0
leaq -0xe0(%rbp), %rdi
callq 0x17130
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
leaq -0x100(%rbp), %rdi
callq 0x6e40
movq -0x40(%rbp), %rdi
addq $0x40, %rdi
callq 0x6e70
movq %rax, -0x220(%rbp)
jmp 0x53a1
movq -0x220(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x40(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x120(%rbp)
movq -0x120(%rbp), %rdi
callq 0x6e90
movq %rax, -0x228(%rbp)
jmp 0x53d3
movq -0x228(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x120(%rbp), %rdi
callq 0x6eb0
movq %rax, -0x230(%rbp)
jmp 0x53f6
movq -0x230(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rax
cmpq -0x130(%rbp), %rax
je 0x5638
movq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rdi
callq 0x6e20
movq %rax, -0x238(%rbp)
jmp 0x543b
movq -0x238(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x6ef0
jmp 0x5450
movq -0x30(%rbp), %rax
movq %rax, -0x250(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x248(%rbp)
movq -0x138(%rbp), %rdi
callq 0x6e20
movq %rax, -0x240(%rbp)
jmp 0x547b
movq -0x240(%rbp), %rcx
movq -0x248(%rbp), %rdx
movq -0x250(%rbp), %rsi
movq -0x138(%rbp), %rax
movl 0x4(%rax), %r8d
movq -0x28(%rbp), %rax
movq 0x58(%rax), %r9
movl 0x50(%rax), %edi
movq %rsp, %rax
movl %edi, (%rax)
leaq -0xe0(%rbp), %rdi
callq 0x20080
jmp 0x54b9
cmpq $0x0, -0x108(%rbp)
je 0x561f
movq -0x108(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x158(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x138(%rbp), %rdi
callq 0x6e20
movq %rax, -0x258(%rbp)
jmp 0x5504
movq -0x258(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x30(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x170(%rbp), %rdx
callq 0x1ccf0
movb %al, -0x259(%rbp)
jmp 0x5543
movb -0x259(%rbp), %al
testb $0x1, %al
jne 0x5552
jmp 0x561d
movl $0x0, -0x174(%rbp)
movl -0x170(%rbp), %eax
movl %eax, -0x178(%rbp)
movl -0x174(%rbp), %eax
cmpl -0x178(%rbp), %eax
jge 0x561b
movq -0x168(%rbp), %rax
movslq -0x174(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rax
movq (%rax), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x6ef0
jmp 0x55ae
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x180(%rbp), %rax
movq (%rax), %rcx
movl 0x8(%rax), %r8d
movq -0x28(%rbp), %rax
movq 0x58(%rax), %r9
movl 0x50(%rax), %edi
movq %rsp, %rax
movl %edi, (%rax)
leaq -0xe0(%rbp), %rdi
callq 0x20080
jmp 0x55e2
jmp 0x55e4
movl -0x174(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x174(%rbp)
jmp 0x5568
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x110(%rbp)
movl %eax, -0x114(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x6f50
jmp 0x5950
jmp 0x561d
jmp 0x561f
jmp 0x5621
movq -0x128(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x128(%rbp)
jmp 0x5404
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
leaq -0xe0(%rbp), %rdi
callq 0x16f70
jmp 0x564e
cmpq $0x0, -0xe8(%rbp)
je 0x569e
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x171b0
jmp 0x566e
movq -0xe8(%rbp), %rdi
leaq 0x1e505(%rip), %rsi     # 0x23b81
xorl %eax, %eax
leaq -0x1b0(%rbp), %rdx
callq 0x3470
movq -0x8(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x69f0
jmp 0x569c
jmp 0x569e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x1b8(%rbp)
cmpq $0x0, -0x1b8(%rbp)
jne 0x56fe
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x260(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x260(%rbp), %edx
movq %rax, %rcx
leaq 0x1e4a9(%rip), %rsi     # 0x23b8a
xorl %eax, %eax
movl $0x10, %edi
callq 0x7a60
jmp 0x56ef
movl $0x3, -0x1bc(%rbp)
jmp 0x591e
movq -0x1b8(%rbp), %rdi
addq $0x4, %rdi
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
callq 0x6f20
movb %al, -0x261(%rbp)
jmp 0x571e
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x572d
jmp 0x57b1
movq -0x1b8(%rbp), %rsi
addq $0x4, %rsi
leaq -0x1e0(%rbp), %rdi
callq 0x171b0
jmp 0x5746
movq -0x18(%rbp), %rsi
addq $0x30, %rsi
leaq -0x210(%rbp), %rdi
callq 0x171b0
jmp 0x575c
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x268(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x268(%rbp), %edx
movq %rax, %rcx
leaq 0x1e421(%rip), %rsi     # 0x23ba7
xorl %eax, %eax
movl $0x10, %edi
leaq -0x1e0(%rbp), %r8
leaq -0x210(%rbp), %r9
callq 0x7a60
jmp 0x57a2
movl $0x3, -0x1bc(%rbp)
jmp 0x591c
movq -0x1b8(%rbp), %rax
cmpl $0x0, (%rax)
je 0x5804
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x26c(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x26c(%rbp), %edx
movq %rax, %rcx
leaq 0x1e3fb(%rip), %rsi     # 0x23be2
xorl %eax, %eax
movl $0x10, %edi
callq 0x7a60
jmp 0x57f5
movl $0x3, -0x1bc(%rbp)
jmp 0x591a
movq -0x40(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
callq 0x6400
movb %al, -0x26d(%rbp)
jmp 0x581c
movb -0x26d(%rbp), %al
testb $0x1, %al
jne 0x5828
jmp 0x586f
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x274(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x274(%rbp), %edx
movq %rax, %rcx
leaq 0x1e3ba(%rip), %rsi     # 0x23c0c
xorl %eax, %eax
movl $0x10, %edi
callq 0x7a60
jmp 0x5860
movl $0x3, -0x1bc(%rbp)
jmp 0x5918
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x64c0
movb %al, -0x275(%rbp)
jmp 0x5884
movb -0x275(%rbp), %al
testb $0x1, %al
jne 0x5890
jmp 0x58d4
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x27c(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x27c(%rbp), %edx
movq %rax, %rcx
leaq 0x1e380(%rip), %rsi     # 0x23c3a
xorl %eax, %eax
movl $0x10, %edi
callq 0x7a60
jmp 0x58c8
movl $0x3, -0x1bc(%rbp)
jmp 0x5916
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0x280(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x6c00
movl -0x280(%rbp), %edx
movq %rax, %rcx
leaq 0x1e369(%rip), %rsi     # 0x23c67
xorl %eax, %eax
movl $0x10, %edi
callq 0x7a60
jmp 0x590c
movl $0x65, -0x1bc(%rbp)
jmp 0x5918
jmp 0x591a
jmp 0x591c
jmp 0x591e
movq -0x20(%rbp), %rdi
callq 0x69b0
jmp 0x5929
movl -0x1bc(%rbp), %eax
movl %eax, -0x284(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x6f50
movl -0x284(%rbp), %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
movq -0x110(%rbp), %rdi
callq 0x35c0
nopl (%rax)