// File: /workspace/github_c_makefile_star2_O1/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 $0xc8, %rsp
movq %r9, 0x50(%rsp)
movq %r8, %r14
movq %rdx, %rbp
movq %rdi, %r15
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x100(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rsi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, 0x48(%rsp)
movq %rcx, %rdx
callq 0x6181
testq %rax, %rax
je 0x5c69
movq %rax, %rcx
movq %r14, 0x80(%rsp)
leaq 0x100(%rsp), %r13
movq (%r13), %rax
movq %rax, 0x38(%rsp)
movq 0x8(%r13), %rax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq 0x48(%rsp), %r14
movq %rbx, 0x40(%rsp)
movq %r15, 0x78(%rsp)
movq %rbp, 0x70(%rsp)
movq %rcx, 0x88(%rsp)
movl $0x38, %esi
movq %r15, %rdi
callq 0x284c
movq %r12, 0x30(%rax)
movq %rax, %r12
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x6181
testq %rax, %rax
je 0x5c9e
movq %rax, %r13
movq %r14, %rbx
movq (%r14), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x8924
cmpq %rbp, %rax
ja 0x5cb5
movq (%rbx), %rsi
addq 0x40(%rsp), %rsi
leaq 0x58(%rsp), %rdi
movq %r13, %rdx
callq 0xaf44
addq %r13, (%rbx)
movq 0x58(%rsp), %r15
movq 0x60(%rsp), %r14
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
jne 0x5cec
movq %r15, %rdi
movl $0x2f, %esi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
movq 0x80(%rsp), %rbx
jne 0x5c7d
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb19e
testb %al, %al
jne 0x5c7d
testq %rbx, %rbx
leaq 0x100(%rsp), %r13
je 0x5b1a
movq 0x10(%rbx), %rax
movq %rax, 0xa0(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x90(%rsp)
jmp 0x5b2e
leaq 0x90(%rsp), %rdi
leaq 0x8c79(%rip), %rsi      # 0xe7a2
callq 0xaf28
movq 0x40(%rsp), %rbx
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0xb0(%rsp), %rdi
movq 0x78(%rsp), %r15
movq %r15, %rsi
callq 0xb2df
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0xaff1
movq 0x50(%rsp), %rax
movq 0x40(%rax), %rdi
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
callq 0xb41f
movl $0x0, 0x18(%r12)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq 0x48(%rsp), %r14
movq %r14, %rdx
callq 0x65fc
movzbl %al, %eax
movl %eax, 0x1c(%r12)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
movq %r14, %rcx
movq 0x50(%rsp), %rbp
movq %rbp, %r8
callq 0x58a3
movq %rax, 0x20(%r12)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq 0x70(%rsp), %rdx
movq %r14, %rcx
movq %r12, %r8
movq %rbp, %r9
movq %rdx, %rbp
callq 0x5986
movq %rax, 0x28(%r12)
movq %r12, %rax
movq 0x88(%rsp), %rcx
decq %rcx
jne 0x5a19
jmp 0x5c6b
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x60(%rsp), %esi
movq 0x58(%rsp), %rdx
leaq 0x890f(%rip), %rdi      # 0xe59c
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %r8
xorl %eax, %eax
callq 0x3dc4
leaq 0x100(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x8894(%rip), %rdi      # 0xe547
jmp 0x5cfd
cmpq $0x1, %r13
leaq 0x879d(%rip), %rdx      # 0xe45d
leaq 0x8adb(%rip), %rax      # 0xe7a2
cmoveq %rax, %rdx
subq %r14, %rbp
leaq 0x87f5(%rip), %rdi      # 0xe4ca
movq %r13, %rsi
movq %rbp, %rcx
movq 0x30(%rsp), %r8
movq 0x38(%rsp), %r9
xorl %eax, %eax
callq 0x3dc4
leaq 0x887f(%rip), %rdi      # 0xe572
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
xorl %eax, %eax
callq 0x3dc4