// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/backup-helpers.c
// Function: applyNodeChanges
void applyNodeChanges(AllocatorPair *allocator_pair, PathNode *node,
                      PathState *state, const struct stat stats)
{
  if(state->uid != stats.st_uid || state->gid != stats.st_gid)
  {
    backupHintSet(node->hint, BH_owner_changed);
    state->uid = stats.st_uid;
    state->gid = stats.st_gid;
  }

  /* Path state specific change checks. */
  if(state->type == PST_regular_file)
  {
    if(state->metadata.file_info.permission_bits != stats.st_mode)
    {
      backupHintSet(node->hint, BH_permissions_changed);
      state->metadata.file_info.permission_bits = stats.st_mode;
    }

    if(state->metadata.file_info.modification_time != stats.st_mtime)
    {
      backupHintSet(node->hint, BH_timestamp_changed);
      state->metadata.file_info.modification_time = stats.st_mtime;
    }

    if(state->metadata.file_info.size != (uint64_t)stats.st_size)
    {
      backupHintSet(node->hint, BH_content_changed);
      state->metadata.file_info.size = stats.st_size;
    }
    else if((node->hint & BH_timestamp_changed) &&
            state->metadata.file_info.size > 0)
    {
      checkFileContentChanges(node, state, stats);
    }
  }
  else if(state->type == PST_symlink)
  {
    StringView target =
      sSymlinkReadTarget(node->path, allocator_pair->reusable_buffer);
    if((off_t)target.length != stats.st_size)
    {
      die("symlink changed while reading: \"" PRI_STR "\"",
          STR_FMT(node->path));
    }

    if(!strIsEqual(state->metadata.symlink_target, target))
    {
      strSet(&state->metadata.symlink_target,
             strCopy(target, allocator_pair->a));
      backupHintSet(node->hint, BH_content_changed);
    }
  }
  else if(state->type == PST_directory)
  {
    if(state->metadata.directory_info.permission_bits != stats.st_mode)
    {
      backupHintSet(node->hint, BH_permissions_changed);
      state->metadata.directory_info.permission_bits = stats.st_mode;
    }

    if(state->metadata.directory_info.modification_time != stats.st_mtime)
    {
      backupHintSet(node->hint, BH_timestamp_changed);
      state->metadata.directory_info.modification_time = stats.st_mtime;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
leaq 0x10(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
cmpl 0x1c(%rcx), %eax
jne 0x267b
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
cmpl 0x20(%rcx), %eax
je 0x26a7
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x10, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movl 0x1c(%rax), %edx
movq -0x18(%rbp), %rcx
movl %edx, 0x4(%rcx)
movl 0x20(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x27a4
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
cmpl 0x18(%rcx), %eax
je 0x26e6
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x20, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
cmpq 0x58(%rcx), %rax
je 0x271c
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x40, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movq 0x58(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq 0x30(%rcx), %rax
je 0x2757
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x80, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x279f
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x279d
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jbe 0x279d
movq -0x50(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rsp, %rdi
movl $0x12, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdi
callq 0x2950
jmp 0x279f
jmp 0x2943
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x28cc
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rsi
leaq -0x30(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc810
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
cmpq 0x30(%rcx), %rax
je 0x280c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x21856(%rip), %rdi     # 0x2405b
movb $0x0, %al
callq 0x4680
movq -0x18(%rbp), %rcx
addq $0x10, %rcx
leaq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0xf4c0
testb $0x1, %al
jne 0x28ca
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq -0x48(%rbp), %rdi
leaq -0x30(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf270
movq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf240
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
andl $-0x10, %ecx
orl $0x80, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
jmp 0x2941
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x293f
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
cmpl 0x18(%rcx), %eax
je 0x2907
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x20, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movl 0x18(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
cmpq 0x58(%rcx), %rax
je 0x293d
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %edx
andl $-0x10, %edx
orl $0x40, %edx
movq -0x10(%rbp), %rcx
movl %edx, 0x18(%rcx)
movq 0x58(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x293f
jmp 0x2941
jmp 0x2943
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)