LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/metadata.c
// Function: metadataWrite
void metadataWrite(Metadata *metadata, StringView repo_path,
                   StringView repo_tmp_file_path,
                   StringView repo_metadata_path)
{
  RepoWriter *writer = repoWriterOpenRaw(
    repo_path, repo_tmp_file_path, str("metadata"), repo_metadata_path);

  /* Count referenced history points and update IDs. */
  size_t id_counter = metadata->current_backup.ref_count > 0;
  for(size_t index = 0; index < metadata->backup_history_length; index++)
  {
    if(metadata->backup_history[index].ref_count > 0)
    {
      metadata->backup_history[index].id = id_counter;
      id_counter = sSizeAdd(id_counter, 1);
    }
  }

  /* Write the backup history. */
  write64(id_counter, writer);

  if(metadata->current_backup.ref_count > 0)
  {
    write64(metadata->current_backup.completion_time, writer);
  }

  for(size_t index = 0; index < metadata->backup_history_length; index++)
  {
    Backup *backup = &metadata->backup_history[index];
    if(backup->ref_count > 0)
    {
      write64(backup->completion_time, writer);
    }
  }

  /* Write the config files history. */
  writePathHistoryList(metadata->config_history, writer);

  /* Write the path tree. */
  write64(metadata->total_path_count, writer);
  writePathList(metadata->paths, writer);

  /* Finish writing. */
  repoWriterClose(writer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
leaq 0x84cb(%rip), %rsi      # 0xe1e9
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0xaf28
movq 0xf0(%rsp), %rax
movq %rax, 0x58(%rsp)
movaps 0xe0(%rsp), %xmm0
movups %xmm0, 0x48(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x40(%rsp)
movups (%r14), %xmm0
movups %xmm0, 0x30(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0xc8(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xb0(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x7b27
xorl %ecx, %ecx
cmpq $0x0, 0x18(%rbx)
movq %rax, %r14
setne %cl
cmpq $0x0, 0x20(%rbx)
je 0x5dd9
movl $0x10, %r15d
xorl %r12d, %r12d
movq 0x28(%rbx), %rax
cmpq $0x0, (%rax,%r15)
je 0x5dcc
movq %rcx, -0x10(%rax,%r15)
movl $0x1, %esi
movq %rcx, %rdi
callq 0x8924
movq %rax, %rcx
incq %r12
addq $0x18, %r15
cmpq 0x20(%rbx), %r12
jb 0x5dac
leaq 0x60(%rsp), %rdi
movq %rcx, (%rdi)
movl $0x8, %esi
movq %r14, %rdx
callq 0x7ba8
cmpq $0x0, 0x18(%rbx)
je 0x5e0e
movq 0x10(%rbx), %rax
leaq 0x60(%rsp), %rdi
movq %rax, (%rdi)
movl $0x8, %esi
movq %r14, %rdx
callq 0x7ba8
cmpq $0x0, 0x20(%rbx)
je 0x5e55
movl $0x10, %r12d
xorl %r13d, %r13d
leaq 0x60(%rsp), %r15
movq 0x28(%rbx), %rax
cmpq $0x0, (%rax,%r12)
je 0x5e48
movq -0x8(%rax,%r12), %rax
movq %rax, 0x60(%rsp)
movl $0x8, %esi
movq %r15, %rdi
movq %r14, %rdx
callq 0x7ba8
incq %r13
addq $0x18, %r12
cmpq 0x20(%rbx), %r13
jb 0x5e23
movq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x5e9f
movq 0x38(%rbx), %rax
leaq 0x60(%rsp), %rdi
movq %rax, (%rdi)
movl $0x8, %esi
movq %r14, %rdx
callq 0x7ba8
movq 0x48(%rbx), %rdi
movq %r14, %rsi
callq 0x6074
movq %r14, %rdi
callq 0x7c01
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/metadata.c
// Function: writePathList
static void writePathList(const PathNode *node_list, RepoWriter *writer)
{
  size_t list_length = 0;
  for(const PathNode *node = node_list; node != NULL; node = node->next)
  {
    if(backupHintNoPol(node->hint) != BH_not_part_of_repository)
    {
      list_length = sSizeAdd(list_length, 1);
    }
  }

  write64(list_length, writer);

  for(const PathNode *node = node_list; node != NULL; node = node->next)
  {
    if(backupHintNoPol(node->hint) != BH_not_part_of_repository)
    {
      StringView name = strSplitPath(node->path).tail;
      write64(name.length, writer);
      repoWriterWrite(name.content, name.length, writer);

      write8(node->policy, writer);
      writePathHistoryList(node->history, writer);
      writePathList(node->subnodes, writer);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
testq %rdi, %rdi
je 0x60b8
movl $0x1ff, %ebp            # imm = 0x1FF
movq %r14, %r15
movl 0x18(%r15), %ecx
andl %ebp, %ecx
cmpl $0x4, %ecx
je 0x60af
movl $0x1, %esi
movq %rax, %rdi
callq 0x8924
movq 0x30(%r15), %r15
testq %r15, %r15
jne 0x6097
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
movl $0x8, %esi
movq %rbx, %rdx
callq 0x7ba8
testq %r14, %r14
je 0x6172
movl $0x1ff, %r15d           # imm = 0x1FF
leaq 0x20(%rsp), %r12
movl 0x18(%r14), %eax
andl %r15d, %eax
cmpl $0x4, %eax
je 0x6165
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x28(%rsp), %rdi
callq 0xb0a5
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %rbp
movq %rbp, 0x20(%rsp)
movl $0x8, %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x7ba8
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x7ba8
movb 0x1c(%r14), %al
movb %al, 0x20(%rsp)
movl $0x1, %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x7ba8
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x5e9f
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x6074
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x60e1
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/metadata.c
// Function: read64
static uint64_t read64(const FileContent content, size_t *reader_position,
                       StringView metadata_path)
{
  assertBytesLeft(*reader_position, sizeof(uint64_t), content,
                  metadata_path);

  uint64_t value;
  memcpy(&value, &content.content[*reader_position], sizeof(value));
  *reader_position += sizeof(value);

  return convertEndian64(value);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
movq (%rdx), %rbp
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %r15
movl $0x8, %esi
movq %rbp, %rdi
callq 0x8924
cmpq %rbx, %rax
ja 0x61d4
movq (%r12), %rcx
movq (%r13,%rcx), %rax
addq $0x8, %rcx
movq %rcx, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rbp, %rbx
leaq 0x82ec(%rip), %rdi      # 0xe4ca
leaq 0x8278(%rip), %rdx      # 0xe45d
movl $0x8, %esi
movq %rbx, %rcx
movl %r15d, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x3dc4
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/metadata.c
// Function: read8
static uint8_t read8(const FileContent content, size_t *reader_position,
                     StringView metadata_path)
{
  assertBytesLeft(*reader_position, sizeof(uint8_t), content,
                  metadata_path);

  const uint8_t byte = content.content[*reader_position];
  *reader_position += sizeof(byte);

  return byte;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
movq (%rdx), %rbp
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %r15
movl $0x1, %esi
movq %rbp, %rdi
callq 0x8924
cmpq %rbx, %rax
ja 0x664e
movq (%r12), %rcx
movb (%r13,%rcx), %al
incq %rcx
movq %rcx, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rbp, %rbx
leaq 0x7e72(%rip), %rdi      # 0xe4ca
leaq 0x8143(%rip), %rdx      # 0xe7a2
movl $0x1, %esi
movq %rbx, %rcx
movl %r15d, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x3dc4
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/metadata.c
// Function: read32
static uint32_t read32(const FileContent content, size_t *reader_position,
                       StringView metadata_path)
{
  assertBytesLeft(*reader_position, sizeof(uint32_t), content,
                  metadata_path);

  uint32_t value;
  memcpy(&value, &content.content[*reader_position], sizeof(value));
  *reader_position += sizeof(value);

  return convertEndian32(value);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
movq (%rdx), %rbp
movq 0x40(%rsp), %r14
movq 0x48(%rsp), %r15
movl $0x4, %esi
movq %rbp, %rdi
callq 0x8924
cmpq %rbx, %rax
ja 0x66c7
movq (%r12), %rcx
movl (%r13,%rcx), %eax
addq $0x4, %rcx
movq %rcx, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
subq %rbp, %rbx
leaq 0x7df9(%rip), %rdi      # 0xe4ca
leaq 0x7d85(%rip), %rdx      # 0xe45d
movl $0x4, %esi
movq %rbx, %rcx
movl %r15d, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x3dc4
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: runGC
static void runGC(const Metadata *metadata, StringView repo_path,
                  const bool prepend_newline)
{
  if(prepend_newline)
  {
    printf("\n");
  }

  GCProgressCallback *gc_progress_callback = NULL;
  if(sIsTTY(stdout))
  {
    gc_progress_callback = gcProgressCallback;
    printf("\n");
    printGCProgress(false, 0, 100, 0);
  }

  const GCStatistics gc_stats = collectGarbageProgress(
    metadata, repo_path, gc_progress_callback, &(GCProgressContext){ 0 });
  printGCProgress(true, 0, 100, gc_stats.deleted_items_total_size);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0x70ff
movl $0xa, %edi
callq 0x2050
leaq 0x50(%rsp), %r14
movq 0xbec5(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
callq 0x9b8f
testb %al, %al
je 0x7148
movl $0xa, %edi
callq 0x2050
leaq 0x75d2(%rip), %r8       # 0xe6fa
leaq 0x75e8(%rip), %r9       # 0xe717
movl $0x64, %edx
xorl %edi, %edi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x753c
leaq 0x382(%rip), %rsi       # 0x74c8
jmp 0x714a
xorl %esi, %esi
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdx
movaps %xmm0, (%rdx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x4091
movq %rdx, %rcx
leaq 0x7582(%rip), %r8       # 0xe6fa
leaq 0x7598(%rip), %r9       # 0xe717
movl $0x64, %edx
movl $0x1, %edi
xorl %esi, %esi
callq 0x753c
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: metadataLoadFromRepo
static Metadata *metadataLoadFromRepo(CR_Region *r, StringView repo_arg,
                                      const RepoLockHint lock_hint)
{
  StringView repo_path = strStripTrailingSlashes(repo_arg);
  StringView metadata_path =
    strAppendPath(repo_path, str("metadata"), allocatorWrapRegion(r));

  if(!sPathExists(metadata_path))
  {
    die("repository has no metadata: \"" PRI_STR "\"", STR_FMT(repo_arg));
  }

  repoLock(r, repo_path, lock_hint);
  return metadataLoad(r, metadata_path);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0xb064
leaq 0x7015(%rip), %rsi      # 0xe1e9
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0xaf28
movq %rbx, %rdi
callq 0x28cc
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xb2df
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x90a4
testb %al, %al
je 0x7279
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7e91
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x56bb
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x74c5(%rip), %rdi      # 0xe753
xorl %eax, %eax
callq 0x3dc4
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: printStats
static void printStats(const char *summary, const TextColor color,
                       const ChangeDetail stats, bool *printed_stats)
{
  if(*printed_stats)
  {
    printf(", ");
  }
  else
  {
    *printed_stats = true;
  }

  printf("%s: ", summary);
  colorPrintf(stdout, color, "%zu", stats.affected_items_count);
  printf(" (");
  printHumanReadableSize(stats.affected_items_total_size);
  printf(")");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
cmpb $0x1, (%r8)
jne 0x72bd
leaq 0x7196(%rip), %rdi      # 0xe44a
xorl %eax, %eax
callq 0x2150
jmp 0x72c1
movb $0x1, (%r8)
leaq 0x7002(%rip), %rdi      # 0xe2ca
movq %r15, %rsi
xorl %eax, %eax
callq 0x2150
movq 0xbcf7(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
leaq 0x71a4(%rip), %rdx      # 0xe487
movl %ebp, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3cd8
leaq 0x7444(%rip), %rdi      # 0xe73a
xorl %eax, %eax
callq 0x2150
movq %rbx, %rdi
callq 0x4478
movl $0x29, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: ensureUserConsent
static void ensureUserConsent(const char *question,
                              Allocator *reusable_buffer)
{
  while(true)
  {
    printf("%s (y/n) ", question);
    if(!sIsTTY(stdin))
    {
      printf("\n");
    }

    StringView line = str("");
    if(!sReadLine(stdin, reusable_buffer, &line) ||
       strIsEqual(line, str("n")) || strIsEqual(line, str("no")))
    {
      exit(EXIT_FAILURE);
    }
    if(strIsEqual(line, str("y")) || strIsEqual(line, str("yes")))
    {
      break;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0xbca1(%rip), %rbp      # 0x12fd8
leaq 0x30(%rsp), %r13
leaq 0x77bd(%rip), %r15      # 0xeb00
leaq 0x60(%rsp), %r12
leaq 0x7398(%rip), %rdi      # 0xe6e7
movq %r14, %rsi
xorl %eax, %eax
callq 0x2150
movq (%rbp), %rdi
callq 0x9b8f
testb %al, %al
jne 0x7370
movl $0xa, %edi
callq 0x2050
movq %r13, %rdi
leaq 0x7428(%rip), %rsi      # 0xe7a2
callq 0xaf28
movq (%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x99e6
testb %al, %al
je 0x74be
leaq 0x90(%rsp), %rdi
leaq 0x734c(%rip), %rsi      # 0xe6f1
callq 0xaf28
movq 0xa0(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb126
testb %al, %al
jne 0x74be
leaq 0x78(%rsp), %rdi
leaq 0x7303(%rip), %rsi      # 0xe6f3
callq 0xaf28
movq 0x88(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x78(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb126
testb %al, %al
jne 0x74be
movq %r12, %rdi
movq %r15, %rsi
callq 0xaf28
movq 0x70(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x60(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb126
testb %al, %al
jne 0x74ac
leaq 0x48(%rsp), %rdi
leaq 0x7283(%rip), %rsi      # 0xe6f6
callq 0xaf28
movq 0x58(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb126
testb %al, %al
je 0x7348
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x23c0
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: gcProgressCallback
static void gcProgressCallback(const uint64_t deleted_items_size,
                               const size_t max_call_limit,
                               void *user_data)
{
  GCProgressContext *ctx = user_data;

  if(shouldUpdateProgressLine(&ctx->last_print_timestamp))
  {
    printGCProgress(false, ctx->items_visited, max_call_limit,
                    deleted_items_size);
  }
  ctx->items_visited++;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rdx), %rdi
callq 0x750a
testb %al, %al
je 0x7501
movq (%rbx), %rsi
leaq 0x720d(%rip), %r8       # 0xe6fa
leaq 0x7223(%rip), %r9       # 0xe717
xorl %edi, %edi
movq %r15, %rdx
movq %r14, %rcx
callq 0x753c
incq (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: shouldUpdateProgressLine
static bool shouldUpdateProgressLine(uint64_t *last_print_timestamp)
{
  const uint64_t now = sTimeMilliseconds();
  if(sUint64GetDifference(*last_print_timestamp, now) > 50)
  {
    *last_print_timestamp = now;
    return true;
  }
  return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x9c9c
movq %rax, %r14
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x899c
cmpq $0x33, %rax
jb 0x752d
movq %r14, (%rbx)
cmpq $0x33, %rax
setae %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: printProgress
static void printProgress(const bool assume_is_finished,
                          const uint64_t processed_amount,
                          const uint64_t total_amount,
                          const uint64_t amount_to_format,
                          const char *info_text,
                          const char *formatted_action_suffix)
{
  startOverprintingPreviousLine();
  printf("%s... ", info_text);

  if(assume_is_finished)
  {
    colorPrintf(stdout, TC_bold, "100.0%%");
    printf(" (");
    printHumanReadableSize(amount_to_format);
    printf(" %s)\n", formatted_action_suffix);
  }
  else if(processed_amount >= total_amount)
  {
    printf("99.9%% (");
    printHumanReadableSize(amount_to_format);
    printf(" %s)\n", formatted_action_suffix);
  }
  else if(processed_amount > 0)
  {
    const size_t permille =
      sUint64Mul(processed_amount, 1000) / total_amount;
    printf("%3zu.%zu%% (", permille / 10, permille % 10);
    printHumanReadableSize(amount_to_format);
    printf(" %s)\n", formatted_action_suffix);
  }
  else
  {
    printf("\n");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %ebp
movq 0xba70(%rip), %rbx      # 0x12fd0
movq (%rbx), %rdi
callq 0x9b8f
testb %al, %al
je 0x757a
leaq 0x71d7(%rip), %rdi      # 0xe74a
xorl %eax, %eax
callq 0x2150
leaq 0x719e(%rip), %rdi      # 0xe71f
movq %r13, %rsi
xorl %eax, %eax
callq 0x2150
testb %bpl, %bpl
je 0x75af
movq (%rbx), %rdi
leaq 0x718c(%rip), %rdx      # 0xe726
movl $0x1, %esi
xorl %eax, %eax
callq 0x3cd8
leaq 0x718d(%rip), %rdi      # 0xe73a
jmp 0x7607
cmpq %r15, %r12
jae 0x7600
testq %r12, %r12
je 0x7636
movl $0x3e8, %esi            # imm = 0x3E8
movq %r12, %rdi
callq 0x8978
xorl %edx, %edx
divq %r15
movq %rax, %rcx
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rdx
shrq $0x3, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
subq %rax, %rcx
leaq 0x714c(%rip), %rdi      # 0xe73d
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2150
jmp 0x760e
leaq 0x712d(%rip), %rdi      # 0xe734
xorl %eax, %eax
callq 0x2150
movq %r14, %rdi
callq 0x4478
leaq 0x7111(%rip), %rdi      # 0xe72e
movq (%rsp), %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/nb.c
// Function: integrityProgressCallback
static void
integrityProgressCallback(const uint64_t processed_block_size,
                          const uint64_t total_bytes_to_process,
                          void *user_data)
{
  IntegrityProgressContext *ctx = user_data;

  ctx->bytes_processed =
    sUint64Add(ctx->bytes_processed, processed_block_size);
  if(sIsTTY(stdout) &&
     shouldUpdateProgressLine(&ctx->last_print_timestamp))
  {
    printIntegrityProgress(false, ctx->bytes_processed,
                           total_bytes_to_process);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %rsi
movq (%rdx), %rdi
callq 0x8960
movq %rax, (%r14)
movq 0xb963(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
callq 0x9b8f
testb %al, %al
je 0x76ab
leaq 0x8(%r14), %rdi
callq 0x750a
testb %al, %al
je 0x76ab
movq (%r14), %rcx
leaq 0x7148(%rip), %r8       # 0xe7d8
leaq 0x7154(%rip), %r9       # 0xe7eb
xorl %edi, %edi
movq %rcx, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x753c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: fillPathBufferWithInfo
static void fillPathBufferWithInfo(StringView repo_path,
                                   const RegularFileInfo *info)
{
  /* The +1 is for the slash after the repo path. */
  size_t required_capacity = getFilePathRequiredCapacity(info) + 1;
  required_capacity = sSizeAdd(required_capacity, repo_path.length);
  path_buffer = CR_EnsureCapacity(path_buffer, required_capacity);

  memcpy(path_buffer, repo_path.content, repo_path.length);
  path_buffer[repo_path.length] = '/';

  char *hash_buffer = &path_buffer[repo_path.length + 1];
  buildFilePath(hash_buffer, info);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x778b
leaq 0x1(%rax), %rdi
movq 0x28(%rsp), %r14
movq %r14, %rsi
callq 0x8924
movq 0xbb2b(%rip), %rdi      # 0x13250
movq %rax, %rsi
callq 0xda26
movq %rax, %r15
movq %rax, 0xbb19(%rip)      # 0x13250
movq 0x20(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x2280
leaq (%r15,%r14), %rdi
incq %rdi
movb $0x2f, -0x1(%rdi)
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x77ce
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: buildFilePath
static void buildFilePath(char *buffer, const RegularFileInfo *info)
{
  sprintf(buffer, "%02x", info->hash[0]);
  sprintf(&buffer[3], "%02x", info->hash[1]);
  buffer[2] = buffer[1];
  buffer[1] = '/';
  buffer[5] = buffer[4];
  buffer[4] = '/';
  buffer += 2;

  for(size_t index = 2; index < FILE_HASH_SIZE; index++)
  {
    sprintf(&buffer[index * 2], "%02x", info->hash[index]);
  }

  char *suffix_buffer = &buffer[FILE_HASH_SIZE * 2];
  sprintf(suffix_buffer, "x%" PRIx64 "x%x", info->size, info->slot);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movzbl 0x18(%rsi), %edx
leaq 0x7193(%rip), %r15      # 0xe97b
movq %r15, %rsi
xorl %eax, %eax
callq 0x23b0
leaq 0x3(%rbx), %rdi
movzbl 0x19(%r14), %edx
movq %r15, %rsi
xorl %eax, %eax
callq 0x23b0
movb 0x1(%rbx), %al
movb 0x4(%rbx), %cl
movb %al, 0x2(%rbx)
movb $0x2f, %al
movb %al, 0x1(%rbx)
movb %cl, 0x5(%rbx)
movb %al, 0x4(%rbx)
leaq 0x6(%rbx), %r12
movq $-0x12, %r13
movzbl 0x2c(%r14,%r13), %edx
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x23b0
addq $0x2, %r12
incq %r13
jne 0x7824
addq $0x2a, %rbx
movq 0x10(%r14), %rdx
movzbl 0x2c(%r14), %ecx
leaq 0x712c(%rip), %rsi      # 0xe980
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x23b0
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: repoReaderOpenFile
RepoReader *repoReaderOpenFile(StringView repo_path,
                               StringView source_file_path,
                               const RegularFileInfo *info)
{
  fillPathBufferWithInfo(repo_path, info);
  FILE *stream = fopen(path_buffer, "rb");
  if(stream == NULL)
  {
    dieErrno("failed to open \"" PRI_STR "\" in \"" PRI_STR "\"",
             STR_FMT(source_file_path), STR_FMT(repo_path));
  }

  RepoReader *reader = sMalloc(sizeof *reader);
  strSet(&reader->repo_path, repo_path);
  strSet(&reader->source_file_path, source_file_path);
  reader->stream = stream;

  return reader;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x58(%rsp), %r15
leaq 0x40(%rsp), %r12
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movaps (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x7700
movq 0xb9b5(%rip), %rdi      # 0x13250
leaq 0x6f68(%rip), %rsi      # 0xe80a
callq 0x2370
testq %rax, %rax
je 0x7904
movq %rax, %rbx
movl $0x38, %edi
callq 0x89b0
movq %rax, %r14
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0xaff1
leaq 0x18(%r14), %rdi
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0xaff1
movq %rbx, 0x30(%r14)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0x8(%r15), %esi
movq (%r15), %rdx
movl 0x8(%r12), %ecx
movq (%r12), %r8
leaq 0x6ef2(%rip), %rdi      # 0xe80d
xorl %eax, %eax
callq 0x3e8c
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: repoReaderRead
void repoReaderRead(void *data, const size_t size, RepoReader *reader)
{
  if(fread(data, 1, size, reader->stream) != size)
  {
    StringView repo_path = reader->repo_path;
    StringView source_file_path = reader->source_file_path;
    const bool reached_end_of_file = feof(reader->stream);

    const int old_errno = errno;
    fclose(reader->stream);
    errno = old_errno;

    free(reader);

    if(reached_end_of_file)
    {
      die("reading \"" PRI_STR "\" from \"" PRI_STR
          "\": reached end of file unexpectedly",
          STR_FMT(source_file_path), STR_FMT(repo_path));
    }
    else
    {
      dieErrno("IO error while reading \"" PRI_STR "\" from \"" PRI_STR
               "\"",
               STR_FMT(source_file_path), STR_FMT(repo_path));
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq 0x30(%rdx), %rcx
movl $0x1, %esi
movq %rbx, %rdx
callq 0x20c0
cmpq %rbx, %rax
jne 0x795b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rax
movq %rax, 0x10(%rsp)
movl 0x8(%r15), %eax
movl %eax, 0xc(%rsp)
movq 0x18(%r15), %r14
movl 0x20(%r15), %r12d
movq 0x30(%r15), %rdi
callq 0x2260
movl %eax, %r13d
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movq 0x30(%r15), %rdi
callq 0x2100
movl %ebp, (%rbx)
movq %r15, %rdi
callq 0x2040
testl %r13d, %r13d
jne 0x79be
leaq 0x6ec2(%rip), %rdi      # 0xe86a
movl %r12d, %esi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x3e8c
leaq 0x6e68(%rip), %rdi      # 0xe82d
movl %r12d, %esi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x3dc4
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: repoReaderClose
void repoReaderClose(RepoReader *reader_to_close)
{
  RepoReader reader = *reader_to_close;
  free(reader_to_close);

  if(fclose(reader.stream) != 0)
  {
    dieErrno("failed to close \"" PRI_STR "\" in \"" PRI_STR "\"",
             STR_FMT(reader.source_file_path), STR_FMT(reader.repo_path));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %rbx
movq 0x8(%rdi), %r14
movq 0x18(%rdi), %r15
movq 0x20(%rdi), %r12
movq 0x30(%rdi), %r13
callq 0x2040
movq %r13, %rdi
callq 0x2100
testl %eax, %eax
jne 0x7a12
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x6e7b(%rip), %rdi      # 0xe894
movl %r12d, %esi
movq %r15, %rdx
movl %r14d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3e8c
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: createRepoWriter
static RepoWriter *createRepoWriter(StringView repo_path,
                                    StringView repo_tmp_file_path,
                                    StringView source_file_path,
                                    const bool raw_mode)
{
  FileStream *stream = sFopenWrite(repo_tmp_file_path);
  RepoWriter *writer = sMalloc(sizeof *writer);

  strSet(&writer->repo_path, repo_path);
  strSet(&writer->repo_tmp_file_path, repo_tmp_file_path);
  strSet(&writer->source_file_path, source_file_path);
  writer->stream = stream;
  writer->raw_mode = raw_mode;

  return writer;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8b25
movq %rax, %r14
movl $0x70, %edi
callq 0x89b0
movq %rax, %r15
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xaff1
leaq 0x18(%r15), %rdi
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xaff1
leaq 0x30(%r15), %rdi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xaff1
movq %r14, 0x48(%r15)
movb %bl, 0x50(%r15)
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: repoWriterWrite
void repoWriterWrite(const void *data, const size_t size,
                     RepoWriter *writer)
{
  if(!fWrite(data, size, writer->stream))
  {
    StringView repo_path = writer->repo_path;
    StringView source_file_path = writer->source_file_path;

    fDestroy(writer->stream);
    free(writer);

    dieErrno("IO error while writing \"" PRI_STR "\" to \"" PRI_STR "\"",
             STR_FMT(source_file_path), STR_FMT(repo_path));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq 0x48(%rdx), %rdx
callq 0x8cab
testb %al, %al
je 0x7bc9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %r14
movl 0x8(%rbx), %ebp
movq 0x30(%rbx), %r15
movl 0x38(%rbx), %r12d
movq 0x48(%rbx), %rdi
callq 0x8dc6
movq %rbx, %rdi
callq 0x2040
leaq 0x6cc6(%rip), %rdi      # 0xe8b5
movl %r12d, %esi
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x3e8c
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: repoLock
void repoLock(CR_Region *r, StringView repo_path,
              const RepoLockHint lock_hint)
{
  const int old_errno = errno;
  Allocator *a = allocatorWrapRegion(r);

  LockfileInfo *lockfile_info = CR_RegionAlloc(r, sizeof *lockfile_info);
  lockfile_info->is_locked = false;
  lockfile_info->file_path =
    strGetContent(strAppendPath(repo_path, str("lockfile"), a), a);
  lockfile_info->file_descriptor =
    open(lockfile_info->file_path, O_CREAT | O_WRONLY, S_IWUSR | S_IWGRP);

  if(lockfile_info->file_descriptor == -1)
  {
    if(errno == EROFS && lock_hint == RLH_readonly)
    {
      errno = old_errno;
      return;
    }
    dieErrno("failed to create lockfile: \"%s\"",
             lockfile_info->file_path);
  }
  CR_RegionAttach(r, cleanupLockfile, lockfile_info);

  if(lockf(lockfile_info->file_descriptor, F_TLOCK, 0) == 0)
  {
    lockfile_info->is_locked = true;
  }
  else if(errno == EACCES || errno == EAGAIN)
  {
    die("repository is already being used by another process");
  }
  else
  {
    dieErrno("failed to lock repository: \"%s\"",
             lockfile_info->file_path);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %esi, 0x34(%rsp)
movq %rdi, %r15
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movq %r15, %rdi
callq 0x28cc
movq %rax, %r12
movl $0x10, %esi
movq %r15, %rdi
callq 0xdd40
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x631d(%rip), %rsi      # 0xe1f2
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0xaf28
movq 0x10(%r13), %rax
movq %rax, 0x28(%rsp)
movups (%r13), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0xa0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0xb2df
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0xaf53
movq %rax, 0x8(%r14)
movq %rax, %rdi
movl $0x41, %esi
movl $0x90, %edx
xorl %eax, %eax
callq 0x2360
movl %eax, 0x4(%r14)
cmpl $-0x1, %eax
je 0x7f85
leaq 0x7b(%rip), %rsi        # 0x7fdb
movq %r15, %rdi
movq %r14, %rdx
callq 0xde19
movl 0x4(%r14), %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2180
testl %eax, %eax
jne 0x7fa2
movb $0x1, (%r14)
jmp 0x7f93
cmpl $0x1, 0x34(%rsp)
jne 0x7fbc
cmpl $0x1e, (%rbx)
jne 0x7fbc
movl %ebp, (%rbx)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl (%rbx), %eax
cmpl $0xd, %eax
je 0x7fae
cmpl $0xb, %eax
jne 0x7fc9
leaq 0x696e(%rip), %rdi      # 0xe923
xorl %eax, %eax
callq 0x3dc4
movq 0x8(%r14), %rsi
leaq 0x693c(%rip), %rdi      # 0xe903
jmp 0x7fd4
movq 0x8(%r14), %rsi
leaq 0x6983(%rip), %rdi      # 0xe957
xorl %eax, %eax
callq 0x3e8c
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/repository.c
// Function: cleanupLockfile
static void cleanupLockfile(void *lockfile_info_ptr)
{
  const LockfileInfo *info = lockfile_info_ptr;

  const int old_errno = errno;
  if(info->is_locked)
  {
    (void)lockf(info->file_descriptor, F_ULOCK, 0);
    (void)close(info->file_descriptor);
    (void)remove(info->file_path);
  }
  else
  {
    (void)close(info->file_descriptor);
  }
  errno = old_errno;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movl 0x4(%r14), %edi
cmpb $0x1, (%r14)
jne 0x8013
xorl %esi, %esi
xorl %edx, %edx
callq 0x2180
movl 0x4(%r14), %edi
callq 0x21c0
movq 0x8(%r14), %rdi
callq 0x2080
jmp 0x8018
callq 0x21c0
movl %ebp, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: initiateRestore
void initiateRestore(Metadata *metadata, const size_t id, StringView path)
{
  AllocatorPair allocator_pair = {
    .a = allocatorWrapRegion(metadata->r),
    .reusable_buffer = allocatorWrapOneSingleGrowableBuffer(metadata->r),
  };

  if(strIsEmpty(path))
  {
    for(PathNode *node = metadata->paths; node != NULL; node = node->next)
    {
      const PathState *state = searchExistingPathState(node, id);
      if(state != NULL)
      {
        checkAndHandleChangesRecursively(&allocator_pair, node, state, id,
                                         true);
      }
    }
  }
  else
  {
    initiateRestoreRecursively(&allocator_pair, metadata->paths, id, path,
                               true);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x28cc
movq %rax, 0x20(%rsp)
movq (%r14), %rdi
callq 0x28e6
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb11c
movq 0x48(%r14), %r14
testb %al, %al
je 0x80a5
testq %r14, %r14
je 0x80cf
leaq 0x20(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0x80d9
testq %rax, %rax
je 0x809a
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x810d
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x8073
jmp 0x80cf
leaq 0x50(%rsp), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl $0x1, %ecx
callq 0x818a
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: searchExistingPathState
static const PathState *searchPathState(const PathNode *node,
                                        const size_t id)
{
  if(node->policy != BPOL_track)
  {
    return &node->history->state;
  }

  for(PathHistory *point = node->history; point != NULL;
      point = point->next)
  {
    if(point->backup->id >= id)
    {
      return &point->state;
    }
  }

  return NULL;
}

// Assembly:
cmpl $0x3, 0x1c(%rdi)
movq 0x20(%rdi), %rcx
jne 0x80f6
testq %rcx, %rcx
je 0x80fc
movq (%rcx), %rax
cmpq %rsi, (%rax)
jae 0x80f6
movq 0x48(%rcx), %rcx
jmp 0x80e3
addq $0x8, %rcx
jmp 0x80fe
xorl %ecx, %ecx
xorl %eax, %eax
testq %rcx, %rcx
je 0x810c
cmpl $0x0, (%rcx)
cmovneq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: checkAndHandleChangesRecursively
static void checkAndHandleChangesRecursively(AllocatorPair *allocator_pair,
                                             PathNode *node,
                                             const PathState *state,
                                             const size_t id,
                                             bool could_exist)
{
  checkAndHandleChanges(allocator_pair, node, state, could_exist);
  if(state->type != PST_directory)
  {
    return;
  }
  if(backupHintNoPol(node->hint) >= BH_added &&
     backupHintNoPol(node->hint) <= BH_other_to_directory)
  {
    could_exist = false;
  }

  for(PathNode *subnode = node->subnodes; subnode != NULL;
      subnode = subnode->next)
  {
    const PathState *subnode_state = searchExistingPathState(subnode, id);
    if(subnode_state != NULL)
    {
      checkAndHandleChangesRecursively(allocator_pair, subnode,
                                       subnode_state, id, could_exist);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movl %r8d, %ecx
callq 0x8651
cmpl $0x3, (%r12)
jne 0x8181
movl $0x1fe, %eax            # imm = 0x1FE
andl 0x18(%r15), %eax
addl $-0xe, %eax
cmpl $-0xc, %eax
setb %al
movq 0x28(%r15), %r15
testq %r15, %r15
je 0x8181
andb %bpl, %al
movzbl %al, %ebp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x80d9
testq %rax, %rax
je 0x8178
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x810d
movq 0x30(%r15), %r15
testq %r15, %r15
jne 0x8154
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: restoreFile
void restoreFile(StringView path, const RegularFileInfo *info,
                 StringView repo_path)
{
  if(info->size > FILE_HASH_SIZE)
  {
    RepoReader *reader = repoReaderOpenFile(repo_path, path, info);
    FileStream *writer = sFopenWrite(path);
    uint64_t bytes_left = info->size;
    char buffer[4096];

    while(bytes_left > 0)
    {
      const size_t bytes_to_read =
        bytes_left > sizeof(buffer) ? sizeof(buffer) : bytes_left;

      repoReaderRead(buffer, bytes_to_read, reader);
      sFwrite(buffer, bytes_to_read, writer);

      bytes_left -= bytes_to_read;
    }

    repoReaderClose(reader);
    sFclose(writer);
  }
  else
  {
    FileStream *writer = sFopenWrite(path);
    sFwrite(info->hash, info->size, writer);
    sFclose(writer);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, %rbx
leaq 0x1070(%rsp), %r15
cmpq $0x15, 0x10(%rdi)
jb 0x83be
leaq 0x1088(%rsp), %rax
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x7867
movq %rax, %r14
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x8b25
movq %rax, %r15
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0x839c
movl $0x1000, %ebp           # imm = 0x1000
leaq 0x30(%rsp), %rbx
cmpq %rbp, %r13
movl $0x1000, %r12d          # imm = 0x1000
cmovbq %r13, %r12
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x7922
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x8c6a
subq %r12, %r13
jne 0x836e
movq %r14, %rdi
callq 0x79db
movq %r15, %rdi
callq 0x8d89
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x8b25
movq %rax, %r14
movq 0x10(%rbx), %rsi
addq $0x18, %rbx
movq %rbx, %rdi
movq %rax, %rdx
callq 0x8c6a
movq %r14, %rdi
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8d89
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: checkAndHandleChanges
static void checkAndHandleChanges(AllocatorPair *allocator_pair,
                                  PathNode *node, const PathState *state,
                                  const bool could_exist)
{
  if(could_exist && sPathExists(node->path))
  {
    const struct stat stats =
      state->type == PST_symlink ? sLStat(node->path) : sStat(node->path);

    handleFiletypeChanges(node, state, stats);
    if(backupHintNoPol(node->hint) == BH_none)
    {
      PathState dummy_state = *state;
      applyNodeChanges(allocator_pair, node, &dummy_state, stats);
    }
  }
  else
  {
    backupHintSet(node->hint, BH_added);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
movq %rsi, %rbx
testl %ecx, %ecx
je 0x86a8
movq %rdx, %r15
movq %rdi, %r14
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x90a4
testb %al, %al
je 0x86a8
cmpl $0x2, (%r15)
jne 0x86c3
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0x91bf
jmp 0x86e0
movl $0xfffffe00, %eax       # imm = 0xFFFFFE00
andl 0x18(%rbx), %eax
orl $0x2, %eax
movl %eax, 0x18(%rbx)
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0x9142
movl 0xa8(%rsp), %eax
movl (%r15), %ecx
cmpl $0x3, %ecx
je 0x8743
cmpl $0x2, %ecx
je 0x8722
cmpl $0x1, %ecx
jne 0x8799
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
je 0x8779
cmpl $0x8000, %eax           # imm = 0x8000
je 0x8799
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x8787
movl $0x9, %eax
jmp 0x878c
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
je 0x8799
cmpl $0x8000, %eax           # imm = 0x8000
je 0x8764
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x8772
movl $0xa, %eax
jmp 0x878c
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
je 0x8799
cmpl $0x8000, %eax           # imm = 0x8000
je 0x876b
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x8780
movl $0x8, %eax
jmp 0x878c
movl $0x5, %eax
jmp 0x878c
movl $0x6, %eax
jmp 0x878c
movl $0xc, %eax
jmp 0x878c
movl $0x7, %eax
jmp 0x878c
movl $0xd, %eax
jmp 0x878c
movl $0xb, %eax
movl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
andl 0x18(%rbx), %ecx
orl %eax, %ecx
movl %ecx, 0x18(%rbx)
movzwl 0x18(%rbx), %eax
testl $0x1ff, %eax            # imm = 0x1FF
jne 0x86b6
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups 0x30(%r15), %xmm3
leaq 0x120(%rsp), %rdx
movaps %xmm3, 0x30(%rdx)
movaps %xmm2, 0x20(%rdx)
movaps %xmm1, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x90(%rsp), %rsi
movl $0x12, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2924
jmp 0x86b6
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: findExistingPathState
static const PathState *findExistingPathState(const PathNode *node,
                                              const size_t id)
{
  const PathState *state = searchExistingPathState(node, id);

  if(state == NULL)
  {
    die("path didn't exist at the specified time: \"" PRI_STR "\"",
        STR_FMT(node->path));
  }

  return state;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x80d9
testq %rax, %rax
je 0x8805
popq %rbx
retq
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x61d6(%rip), %rdi      # 0xe9e8
xorl %eax, %eax
callq 0x3dc4
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/restore.c
// Function: restorePath
static void restorePath(const PathNode *node, const PathState *state,
                        StringView repo_path)
{
  if(state->type == PST_regular_file)
  {
    restoreFile(node->path, &state->metadata.file_info, repo_path);
    sChown(node->path, state->uid, state->gid);
    sChmod(node->path, state->metadata.file_info.permission_bits);
    sUtime(node->path, state->metadata.file_info.modification_time);
  }
  else if(state->type == PST_symlink)
  {
    sSymlink(state->metadata.symlink_target, node->path);
    sLChown(node->path, state->uid, state->gid);
  }
  else if(state->type == PST_directory)
  {
    sMkdir(node->path);
    sChown(node->path, state->uid, state->gid);
    sChmod(node->path, state->metadata.directory_info.permission_bits);
    sUtime(node->path, state->metadata.directory_info.modification_time);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x3, %eax
je 0x88b7
cmpl $0x2, %eax
je 0x8870
cmpl $0x1, %eax
jne 0x891b
leaq 0x50(%rsp), %rax
leaq 0x10(%r14), %rdi
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x82e6
jmp 0x88cc
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0x10(%rsp)
movups 0x10(%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x92a5
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x95eb
jmp 0x891b
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x923c
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x957b
movl 0x10(%r14), %edi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x9511
movq 0x18(%r14), %rdi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x965b
addq $0x38, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sFopenRead
FileStream *sFopenRead(StringView path)
{
  FileStream *result = newFileStream(path);
  result->handle = fopen(nullTerminate(path), "rb");
  if(result->handle == NULL)
  {
    CR_RegionRelease(result->r);
    dieErrno("failed to open \"" PRI_STR "\" for reading", STR_FMT(path));
  }
  CR_RegionAttach(result->r, closeFileHandle, result);

  return result;
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8a86
movq %rax, %rbx
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %edi, %edi
callq 0x99b5
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xaf53
leaq 0x5dce(%rip), %rsi      # 0xe80a
movq %rax, %rdi
callq 0x2370
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
testq %rax, %rax
je 0x8a68
leaq 0xa7(%rip), %rsi        # 0x8afe
movq %rbx, %rdx
callq 0xde19
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
leaq 0x50(%rsp), %rbx
callq 0xde6a
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x600d(%rip), %rdi      # 0xea8c
xorl %eax, %eax
callq 0x3e8c
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: newFileStream
static FileStream *newFileStream(StringView path)
{
  CR_Region *r = CR_RegionNew();

  FileStream *stream = CR_RegionAlloc(r, sizeof *stream);
  stream->r = r;
  strSet(&stream->path, strCopy(path, allocatorWrapRegion(r)));
  return stream;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0xdc7c
movq %rax, %rbx
movl $0x28, %esi
movq %rax, %rdi
callq 0xdd40
movq %rax, %r14
movq %rbx, (%rax)
leaq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x28cc
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xb003
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xaff1
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: closeFileHandle
static void closeFileHandle(void *data)
{
  FileStream *stream = data;
  if(stream->handle == NULL) return;

  const int old_errno = errno;
  (void)fclose(stream->handle);
  errno = old_errno;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x8b20
callq 0x2060
movq %rax, %r14
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x2100
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq