// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/backup.c
// Function: handleFoundNode
static void handleFoundNode(AllocatorPair *allocator_pair,
                            Metadata *metadata, PathNode *node,
                            const SearchResult result)
{
  handlePolicyChanges(metadata, node, result.policy);

  if(result.policy != BPOL_track)
  {
    handleNodeChanges(allocator_pair, node, &node->history->state, result);

    if(backupHintNoPol(node->hint) != BH_none ||
       result.policy == BPOL_none)
    {
      reassignPointToCurrent(metadata, node->history);
    }
  }
  else if(node->history->state.type == PST_non_existing)
  {
    backupHintSet(node->hint, BH_added);

    PathHistory *point =
      buildPathHistoryPoint(allocator_pair->a, metadata, result);

    point->next = node->history;
    node->history = point;
  }
  else
  {
    PathState state = node->history->state;
    handleNodeChanges(allocator_pair, node, &state, result);

    if(backupHintNoPol(node->hint) != BH_none)
    {
      PathHistory *point = CR_RegionAlloc(metadata->r, sizeof *point);

      memcpy(&point->state, &state, sizeof(point->state));
      point->backup = &metadata->current_backup;
      point->backup->ref_count = sSizeAdd(point->backup->ref_count, 1);

      point->next = node->history;
      node->history = point;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
leaq 0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl 0x28(%rax), %edx
callq 0x3880
movq -0x70(%rbp), %rax
cmpl $0x3, 0x28(%rax)
je 0x33c2
movq -0x70(%rbp), %rsi
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdx
addq $0x8, %rdx
movq %rsp, %rdi
movl $0x18, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdi
callq 0x39a0
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0x0, %eax
jne 0x33ac
movq -0x70(%rbp), %rax
cmpl $0x0, 0x28(%rax)
jne 0x33bd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x3a70
jmp 0x352b
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpl $0x0, 0x8(%rax)
jne 0x3447
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
orl $0x2, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rsp, %rdi
movl $0x18, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdi
callq 0x3270
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x3529
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
addq $0x8, %rsi
leaq -0x60(%rbp), %rdi
movl $0x40, %edx
callq 0x2250
movq -0x70(%rbp), %rsi
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq %rsp, %rdi
movl $0x18, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x39a0
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0x0, %eax
je 0x3527
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x50, %esi
callq 0x230e0
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
addq $0x8, %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
callq 0x2250
movq -0x10(%rbp), %rcx
addq $0x8, %rcx
movq -0x68(%rbp), %rax
movq %rcx, (%rax)
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0xb8f0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x68(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x3529
jmp 0x352b
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nopw %cs:(%rax,%rax)