// File: /workspace/github_c_makefile_star2_O2/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 $0xb8, %rsp
movq %r9, 0x38(%rsp)
movq %r8, 0x70(%rsp)
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, 0x40(%rsp)
leaq 0xf0(%rsp), %rbp
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, 0x48(%rsp)
movq %rcx, %rdx
callq 0x5b4b
xorl %r15d, %r15d
movq %r13, 0x68(%rsp)
subq $0x1, %rax
jb 0x5754
movq %rax, 0x78(%rsp)
movq 0x40(%rsp), %rdi
pushq $0x38
popq %rsi
callq 0x24fc
movq %rax, %rbx
movq %r15, 0x30(%rax)
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r14, %rsi
movq 0x48(%rsp), %r15
movq %r15, %rdx
callq 0x5b4b
testq %rax, %rax
je 0x5769
movq %rax, %r12
movq %r14, %rdx
movq %r13, %r14
movq (%r15), %rdi
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
movq %rdx, %r13
callq 0x5b8f
movq (%r15), %rsi
movq %r15, %rbp
movq %r14, %r15
addq %r14, %rsi
leaq 0x50(%rsp), %rdi
movq %r12, %rdx
callq 0xa3ec
addq %r12, (%rbp)
movq 0x50(%rsp), %rbp
movq 0x58(%rsp), %r12
movq %rbp, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x2200
testq %rax, %rax
jne 0x57a7
movq %rbp, %rdi
pushq $0x2f
popq %rsi
movq %r12, %rdx
callq 0x2200
testq %rax, %rax
jne 0x5783
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xa5bc
testb %al, %al
jne 0x5779
movq 0x70(%rsp), %rcx
testq %rcx, %rcx
leaq 0xf0(%rsp), %rbp
je 0x561c
movq 0x10(%rcx), %rax
movq %rax, 0x90(%rsp)
movups (%rcx), %xmm0
movaps %xmm0, 0x80(%rsp)
jmp 0x5630
leaq 0x80(%rsp), %rdi
leaq 0x9174(%rip), %rsi      # 0xe79f
callq 0xa3d0
movq %r13, %r14
movq 0x60(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x50(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
movq 0x40(%rsp), %r12
movq %r12, %rsi
callq 0xa6c6
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xa0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xa454
movq 0x38(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rsi
callq 0xa7f2
andl $0x0, 0x18(%rbx)
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %r13, %rsi
movq 0x48(%rsp), %r13
movq %r13, %rdx
callq 0x5f4c
movzbl %al, %eax
movl %eax, 0x1c(%rbx)
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq 0x38(%rsp), %r15
movq %r15, %r8
callq 0x53ca
movq %rax, 0x20(%rbx)
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
movq 0x68(%rsp), %r12
movq %r12, %rsi
movq %r14, %rdx
movq %r13, %rcx
movq %rbx, %r8
movq %r15, %r9
callq 0x54ab
movq %rax, 0x28(%rbx)
movq %rbx, %r15
movq 0x78(%rsp), %rax
movq %r12, %r13
jmp 0x5505
movq %r15, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbp), %esi
movq (%rbp), %rdx
leaq 0x8dd0(%rip), %rdi      # 0xe547
jmp 0x57be
movq 0x50(%rsp), %rbp
movq 0x58(%rsp), %r12
leaq 0xf0(%rsp), %r13
movl 0x8(%r13), %ecx
movq (%r13), %r8
leaq 0x8e02(%rip), %rdi      # 0xe59c
movl %r12d, %esi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x3918
leaq 0xf0(%rsp), %r13
movl 0x8(%r13), %esi
movq (%r13), %rdx
leaq 0x8db4(%rip), %rdi      # 0xe572
xorl %eax, %eax
callq 0x3918