// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
leaq 0x10(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x49(%rbp)
je 0xa9cf
movb -0x1a(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xa9db
jmp 0xab8e
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
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 0xaa21
jmp 0xaa59
movb $0x1, -0x1a(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb650
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0xa8b0
jmp 0xab7b
movq -0x48(%rbp), %rax
movq -0x28(%rbp), %rcx
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 0xf6b0
testb $0x1, %al
jne 0xaaa2
jmp 0xab79
movb $0x1, -0x1a(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb650
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpl $0x3, (%rax)
je 0xaadf
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x19eb9(%rip), %rdi     # 0x24991
movb $0x0, %al
callq 0x4680
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x38(%rbp), %rdx
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0xb2f0
xorl %eax, %eax
testb $0x1, -0x19(%rbp)
movb %al, -0x4a(%rbp)
je 0xab37
movq -0x28(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0x1ff, %ecx            # imm = 0x1FF
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x4b(%rbp)
jb 0xab2f
movq -0x28(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0xd, %eax
setbe %al
movb %al, -0x4b(%rbp)
movb -0x4b(%rbp), %al
xorb $-0x1, %al
movb %al, -0x4a(%rbp)
movq -0x48(%rbp), %rcx
movb -0x4a(%rbp), %al
andb $0x1, %al
movb %al, -0x39(%rbp)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x18(%rbp), %rdx
movb -0x39(%rbp), %al
andb $0x1, %al
movq (%rcx), %r8
movq %r8, (%rsp)
movq 0x8(%rcx), %r8
movq %r8, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movzbl %al, %ecx
callq 0xa980
jmp 0xab7b
jmp 0xab7d
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xa9b2
testb $0x1, -0x1a(%rbp)
jne 0xabaf
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x19e20(%rip), %rdi     # 0x249c8
movb $0x0, %al
callq 0x4680
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)