// File: /workspace/github_c_makefile_star2_O2/AlxHnr[P]nano-backup/src/restore.c
// Function: initiateRestoreRecursively
static void initiateRestoreRecursively(AllocatorPair *allocator_pair,
                                       PathNode *node_list,
                                       const size_t id, StringView path,
                                       const bool could_exist)
{
  bool found_node = false;

  for(PathNode *node = node_list; node != NULL && found_node == false;
      node = node->next)
  {
    if(strIsEqual(node->path, path))
    {
      found_node = true;
      const PathState *state = findExistingPathState(node, id);
      checkAndHandleChangesRecursively(allocator_pair, node, state, id,
                                       could_exist);
    }
    else if(strIsParentPath(node->path, path))
    {
      found_node = true;

      const PathState *state = findExistingPathState(node, id);
      if(state->type != PST_directory)
      {
        die("path was not a directory at the specified time: \"" PRI_STR
            "\"",
            STR_FMT(node->path));
      }

      checkAndHandleChanges(allocator_pair, node, state, could_exist);

      const bool subnode_could_exist = could_exist &&
        !(backupHintNoPol(node->hint) >= BH_added &&
          backupHintNoPol(node->hint) <= BH_other_to_directory);

      initiateRestoreRecursively(allocator_pair, node->subnodes, id, path,
                                 subnode_could_exist);
    }
  }

  if(!found_node)
  {
    die("path doesn't exist in repository: \"" PRI_STR "\"",
        STR_FMT(path));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x70(%rsp), %r12
xorl %r13d, %r13d
movzbl %cl, %ebp
testq %rbx, %rbx
je 0x7b29
movl %r13d, %eax
andb $0x1, %al
jne 0x7b29
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0xa564
testb %al, %al
je 0x7a8f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x805a
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x798b
jmp 0x7b1d
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0xa665
testb %al, %al
je 0x7b20
movq %rbx, %rdi
movq %r14, %rsi
callq 0x805a
cmpl $0x3, (%rax)
jne 0x7b3e
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x7ede
testb %bpl, %bpl
je 0x7af6
movl 0x18(%rbx), %eax
movl $0x1fe, %ecx            # imm = 0x1FE
andl %ecx, %eax
addl $-0xe, %eax
cmpl $-0xc, %eax
setb %al
jmp 0x7af8
xorl %eax, %eax
movq 0x28(%rbx), %rsi
movq 0x10(%r12), %rcx
movq %rcx, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movzbl %al, %ecx
movq %r15, %rdi
movq %r14, %rdx
callq 0x7a08
movb $0x1, %r13b
movq 0x30(%rbx), %rbx
jmp 0x7a2a
testb $0x1, %r13b
je 0x7b52
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x6e3a(%rip), %rdi      # 0xe985
xorl %eax, %eax
callq 0x3918
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x6e5a(%rip), %rdi      # 0xe9bc
jmp 0x7b4b