// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/metadata.c
// Function: readPathSubnodes
static PathNode *
readPathSubnodes(Allocator *region_wrapper, const FileContent content,
                 size_t *reader_position, StringView metadata_path,
                 PathNode *parent_node, Metadata *metadata)
{
  const size_t node_count =
    readSize(content, reader_position, metadata_path);
  PathNode *node_tree = NULL;

  for(size_t counter = 0; counter < node_count; counter++)
  {
    PathNode *node = allocate(region_wrapper, sizeof *node);

    /* Prepend current node to node tree. */
    node->next = node_tree;
    node_tree = node;

    /* Read the name and append it to the parent nodes path. */
    const size_t name_length =
      readSize(content, reader_position, metadata_path);
    if(name_length == 0)
    {
      die("contains filename with length zero: \"" PRI_STR "\"",
          STR_FMT(metadata_path));
    }

    assertBytesLeft(*reader_position, name_length, content, metadata_path);

    StringView name =
      strUnterminated(&content.content[*reader_position], name_length);
    *reader_position += name_length;

    if(memchr(name.content, '\0', name.length) != NULL)
    {
      die("contains filename with null-bytes: \"" PRI_STR "\"",
          STR_FMT(metadata_path));
    }
    else if(memchr(name.content, '/', name.length) != NULL ||
            strIsDotElement(name))
    {
      die("contains invalid filename \"" PRI_STR "\": \"" PRI_STR "\"",
          STR_FMT(name), STR_FMT(metadata_path));
    }

    StringView parent_path =
      parent_node == NULL ? str("") : parent_node->path;
    strSet(&node->path, strAppendPath(parent_path, name, region_wrapper));

    /* Read other node variables. */
    strTableMap(metadata->path_table, node->path, node);

    node->hint = BH_none;
    node->policy = read8(content, reader_position, metadata_path);
    node->history = readFullPathHistory(
      region_wrapper, content, reader_position, metadata_path, metadata);

    node->subnodes =
      readPathSubnodes(region_wrapper, content, reader_position,
                       metadata_path, node, metadata);
  }

  return node_tree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, 0x58(%rsp)
movq %r8, %rbx
movq %rcx, %rbp
movq %rsi, %r15
movq %rdi, %r12
movq 0x110(%rsp), %rcx
movq 0x118(%rsp), %r14
movq (%rbp), %rdi
movl $0x8, %esi
movq %rdx, 0x38(%rsp)
movq %rcx, %r13
movq %r14, %r8
callq 0x615b
movq (%rbp), %rax
movq (%r15,%rax), %rcx
addq $0x8, %rax
movq %rax, (%rbp)
testq %rcx, %rcx
je 0x5c35
movq %rbx, 0x88(%rsp)
movq %r12, %rdi
movq %r14, 0x50(%rsp)
xorl %r14d, %r14d
movq 0x38(%rsp), %rbx
movq %r15, 0x80(%rsp)
movq %r12, 0x48(%rsp)
movq %rbp, 0x78(%rsp)
movq %r13, 0x40(%rsp)
movq %rcx, 0x98(%rsp)
movl $0x38, %esi
callq 0x27ac
movq %rax, 0x90(%rsp)
movq %r14, 0x30(%rax)
movq (%rbp), %rdi
movl $0x8, %esi
movq %rbx, %rdx
movq %r13, %rcx
movq 0x50(%rsp), %r12
movq %r12, %r8
callq 0x615b
movq (%rbp), %rdi
movq (%r15,%rdi), %r14
addq $0x8, %rdi
movq %rdi, (%rbp)
testq %r14, %r14
movq %r12, %r8
je 0x5c4d
movq %r14, %rsi
movq %rbx, %rdx
movq %r13, %rcx
movq %r13, %r12
movq %r8, %r13
callq 0x615b
movq (%rbp), %rsi
addq %r15, %rsi
leaq 0x60(%rsp), %rdi
movq %r14, %rdx
callq 0xab78
addq %r14, (%rbp)
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2200
testq %rax, %rax
jne 0x5c80
movq %r14, %rdi
movl $0x2f, %esi
movq %r15, %rdx
callq 0x2200
testq %rax, %rax
jne 0x5c66
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x60(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xadd1
testb %al, %al
jne 0x5c5c
movq 0x88(%rsp), %rcx
testq %rcx, %rcx
movq %r12, %r15
movq 0x48(%rsp), %rbx
je 0x5acd
movq 0x10(%rcx), %rax
movq %rax, 0xb0(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0xa0(%rsp)
jmp 0x5ae1
leaq 0xa0(%rsp), %rdi
leaq 0x8cc3(%rip), %rsi      # 0xe79f
callq 0xab5c
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x60(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xc0(%rsp), %rdi
movq %rbx, %rsi
callq 0xaf03
movq 0xd0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xc0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x90(%rsp), %r12
movq %r12, %rdi
callq 0xac25
movq 0x58(%rsp), %rax
movq 0x40(%rax), %rdi
movq %rax, %r13
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
callq 0xb043
movl $0x0, 0x18(%r12)
movq 0x78(%rsp), %rbp
movq (%rbp), %rdi
movl $0x1, %esi
movq 0x38(%rsp), %rbx
movq %rbx, %rdx
movq %r15, %rcx
movq 0x50(%rsp), %r14
movq %r14, %r8
callq 0x615b
movq (%rbp), %rax
movq 0x80(%rsp), %r15
movzbl (%r15,%rax), %ecx
incq %rax
movq %rax, (%rbp)
movl %ecx, 0x1c(%r12)
movq %r13, (%rsp)
movq 0x48(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq 0x40(%rsp), %r8
movq %r14, %r9
callq 0x585e
movq %rax, 0x20(%r12)
leaq 0x110(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
movq %r12, %r8
movq 0x58(%rsp), %r9
callq 0x5931
movq %r13, %rdi
movq 0x40(%rsp), %r13
movq %rax, 0x28(%r12)
movq %r12, %r14
movq 0x98(%rsp), %rcx
decq %rcx
jne 0x59c4
jmp 0x5c38
xorl %r12d, %r12d
movq %r12, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x88f3(%rip), %rdi      # 0xe547
movl %r8d, %esi
movq %r13, %rdx
jmp 0x5c8d
movq 0x60(%rsp), %r14
movq 0x68(%rsp), %r15
leaq 0x892f(%rip), %rdi      # 0xe59c
movl %r15d, %esi
movq %r14, %rdx
movl %r13d, %ecx
movq %r12, %r8
xorl %eax, %eax
callq 0x3ca8
leaq 0x88eb(%rip), %rdi      # 0xe572
movl %r13d, %esi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3ca8