// File: /workspace/github_c_makefile_star2_O1/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
leaq 0x70(%rsp), %r12
testq %rsi, %rsi
je 0x82d4
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
xorl %r13d, %r13d
movzbl %cl, %ebp
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 0xb126
testb %al, %al
je 0x8206
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87f5
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x810d
jmp 0x8294
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 0xb299
testb %al, %al
je 0x8297
movq %rbx, %rdi
movq %r14, %rsi
callq 0x87f5
cmpl $0x3, (%rax)
jne 0x82c0
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movl %ebp, %ecx
callq 0x8651
testb %bpl, %bpl
je 0x826d
movl 0x18(%rbx), %eax
movl $0x1fe, %ecx            # imm = 0x1FE
andl %ecx, %eax
addl $-0xe, %eax
cmpl $-0xc, %eax
setb %al
jmp 0x826f
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 0x818a
movb $0x1, %r13b
movq 0x30(%rbx), %rbx
testq %rbx, %rbx
je 0x82ab
movl %r13d, %eax
andb $0x1, %al
je 0x81b5
testb $0x1, %r13b
je 0x82d4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x66bb(%rip), %rdi      # 0xe988
xorl %eax, %eax
callq 0x3dc4
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x66db(%rip), %rdi      # 0xe9bf
jmp 0x82cd