LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/garbage-collector.c
// Function: shouldBeRemoved
static bool shouldBeRemoved(StringView path, const struct stat *stats,
                            void *user_data)
{
  GCContext *ctx = user_data;

  StringView path_relative_to_repo =
    strUnterminated(&path.content[ctx->repo_path.length + 1],
                    path.length - ctx->repo_path.length - 1);
  if(strTableGet(ctx->paths_to_preserve, path_relative_to_repo) != NULL)
  {
    if(ctx->progress_callback != NULL)
    {
      ctx->progress_callback(ctx->statistics.deleted_items_total_size,
                             strTableCountMappings(ctx->paths_to_preserve),
                             ctx->callback_user_data);
    }
    return false;
  }

  ctx->statistics.deleted_items_count =
    sSizeAdd(ctx->statistics.deleted_items_count, 1);
  if(S_ISREG(stats->st_mode))
  {
    ctx->statistics.deleted_items_total_size =
      sSizeAdd(ctx->statistics.deleted_items_total_size, stats->st_size);
  }
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq 0x60(%rsp), %rax
movq 0x8(%rsi), %rdx
leaq (%rax,%rdx), %rsi
incq %rsi
notq %rdx
addq 0x68(%rsp), %rdx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0xab78
movq 0x18(%rbx), %rdi
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0xb15e
movq %rax, %r14
testq %rax, %rax
je 0x4317
movq 0x30(%rbx), %r12
testq %r12, %r12
je 0x434a
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %r15
callq 0xb1e2
movq 0x38(%rbx), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq *%r12
jmp 0x434a
movq 0x20(%rbx), %rdi
movl $0x1, %esi
callq 0x8778
movq %rax, 0x20(%rbx)
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x434a
movq 0x28(%rbx), %rdi
movq 0x30(%r15), %rsi
callq 0x8778
movq %rax, 0x28(%rbx)
testq %r14, %r14
sete %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/informations.c
// Function: printHumanReadableSize
void printHumanReadableSize(const uint64_t size)
{
  static const char units[] = "bKMGT";
  double converted_value = (double)size;
  size_t unit_index = 0;

  while(converted_value > 999.9 && unit_index + 2 < sizeof(units))
  {
    converted_value /= 1024.0;
    unit_index++;
  }

  if(unit_index == 0)
  {
    printf("%.0lf b", converted_value);
  }
  else
  {
    const uint64_t fraction = (uint64_t)(converted_value * 10.0) % 10;
    printf("%" PRIu64 ".%" PRIu64 " %ciB", (uint64_t)converted_value,
           fraction, units[unit_index]);
  }
}

// Assembly:
movq %rdi, %xmm1
punpckldq 0x9e97(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x9e9f(%rip), %xmm1     # 0xe210
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
cmpq $0x3e8, %rdi            # imm = 0x3E8
jb 0x4438
xorl %eax, %eax
movsd 0x9e8c(%rip), %xmm1     # 0xe220
movsd 0x9e8c(%rip), %xmm2     # 0xe228
mulsd %xmm1, %xmm0
leaq 0x1(%rax), %rcx
ucomisd %xmm2, %xmm0
jbe 0x43b3
cmpq $0x3, %rax
movq %rcx, %rax
jb 0x439c
movsd 0x9e75(%rip), %xmm1     # 0xe230
mulsd %xmm0, %xmm1
movsd 0x9e71(%rip), %xmm2     # 0xe238
cvttsd2si %xmm1, %rax
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rdx
movq %rax, %r8
sarq $0x3f, %r8
andq %rdx, %r8
orq %rax, %r8
movabsq $-0x3333333333333333, %rdx # imm = 0xCCCCCCCCCCCCCCCD
movq %r8, %rax
mulq %rdx
shrq $0x2, %rdx
andq $-0x2, %rdx
leaq (%rdx,%rdx,4), %rax
cvttsd2si %xmm0, %rdx
subq %rax, %r8
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %rax
movq %rdx, %rsi
sarq $0x3f, %rsi
andq %rax, %rsi
orq %rdx, %rsi
leaq 0x9e5d(%rip), %rax      # 0xe280
movsbl (%rcx,%rax), %ecx
leaq 0x9e60(%rip), %rdi      # 0xe28e
movq %r8, %rdx
xorl %eax, %eax
jmp 0x2150
leaq 0x9e47(%rip), %rdi      # 0xe286
movb $0x1, %al
jmp 0x2150
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/informations.c
// Function: warnUnmatchedExpressions
static void warnUnmatchedExpressions(const RegexList *expression_list,
                                     const char *target_name)
{
  for(const RegexList *expression = expression_list; expression != NULL;
      expression = expression->next)
  {
    if(!expression->has_matched)
    {
      warnConfigLineNr(expression->line_nr);
      fprintf(stderr, "regex never matched a %s: ", target_name);
      warnPathNewline(expression->expression);
    }
  }
}

// Assembly:
testq %rdi, %rdi
je 0x44f3
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x28(%r14)
je 0x44df
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x44cd
jmp 0x44ec
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2673
jmp 0x44d4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/informations.c
// Function: printNodePath
static void printNodePath(const PathNode *node, const TextColor color)
{
  const PathState *state = getExistingState(node);

  colorPrintf(stdout, color, "%s" PRI_STR "%s",
              state->type == PST_symlink ? "^" : "", STR_FMT(node->path),
              state->type == PST_directory ? "/" : "");
}

// Assembly:
movq 0x20(%rdi), %rax
cmpl $0x0, 0x8(%rax)
je 0x5154
movq %rax, %rcx
jmp 0x515d
movq 0x48(%rax), %rcx
testq %rcx, %rcx
je 0x514f
pushq %rax
movq 0xde6b(%rip), %rax      # 0x12fd0
movq (%rax), %rax
movl 0x8(%rcx), %edx
cmpl $0x2, %edx
leaq 0x92d1(%rip), %rcx      # 0xe446
leaq 0x9623(%rip), %r10      # 0xe79f
cmovneq %r10, %rcx
movl 0x8(%rdi), %r8d
movq (%rdi), %r9
cmpl $0x3, %edx
leaq 0x92b7(%rip), %rdx      # 0xe448
cmovneq %r10, %rdx
movq %rdx, (%rsp)
leaq 0x929d(%rip), %rdx      # 0xe43d
movq %rax, %rdi
xorl %eax, %eax
callq 0x3bbc
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/informations.c
// Function: printChangeDetail
static void printChangeDetail(const ChangeDetail details,
                              const char *prefix)
{
  printf("%s%zu item%s", details.affected_items_count > 0 ? prefix : "",
         details.affected_items_count,
         details.affected_items_count == 1 ? "" : "s");

  if(details.affected_items_total_size > 0)
  {
    printf(", %s", prefix);
    printHumanReadableSize(details.affected_items_total_size);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %rdx
testq %rdi, %rdi
leaq 0x95dc(%rip), %rax      # 0xe79f
movq %r14, %rsi
cmoveq %rax, %rsi
cmpq $0x1, %rdi
leaq 0x9288(%rip), %rcx      # 0xe45d
cmoveq %rax, %rcx
leaq 0x926d(%rip), %rdi      # 0xe44d
xorl %eax, %eax
callq 0x2150
testq %rbx, %rbx
je 0x520c
leaq 0x9267(%rip), %rdi      # 0xe45a
movq %r14, %rsi
xorl %eax, %eax
callq 0x2150
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x435c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/informations.c
// Function: incrementExtraChangedAttributes
static void incrementExtraChangedAttributes(ChangeSummary *changes,
                                            const BackupHint hint)
{
  if(hint & BH_owner_changed)
  {
    changes->changed_attributes = sSizeAdd(changes->changed_attributes, 1);
  }
  if(hint & BH_permissions_changed)
  {
    changes->changed_attributes = sSizeAdd(changes->changed_attributes, 1);
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
testb $0x10, %bpl
je 0x5234
movq 0x40(%rbx), %rdi
movl $0x1, %esi
callq 0x8778
movq %rax, 0x40(%rbx)
testb $0x20, %bpl
je 0x524c
movq 0x40(%rbx), %rdi
movl $0x1, %esi
callq 0x8778
movq %rax, 0x40(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/integrity.c
// Function: checkIntegrity
ListOfBrokenPathNodes *checkIntegrity(
  CR_Region *r, const Metadata *metadata, StringView repo_path,
  IntegrityProgressCallback progress_callback, void *callback_user_data)
{
  IntegrityCheckContext ctx = {
    .r = r,
    .broken_nodes = NULL,
    .repo_path = repo_path,
    .progress_callback = progress_callback,
    .callback_user_data = callback_user_data,
  };

  /* Dry run to populate `ctx->files_to_hash_total_size`. */
  CR_Region *disposable_r = attachDisposableRegion(&ctx);
  checkIntegrityRecursively(&ctx, metadata->paths, addToTotalFileSize);
  CR_RegionRelease(disposable_r);
  disposable_r = attachDisposableRegion(&ctx);

  /* Do a real check. */
  checkIntegrityRecursively(&ctx, metadata->paths, storedFileIsHealthy);
  CR_RegionRelease(disposable_r);

  return ctx.broken_nodes;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %r14
movq %rsp, %rbx
movq %rdi, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movaps 0x80(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x90(%rsp), %rsi
movq %rsi, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x38(%rbx)
movq %rax, 0x48(%rbx)
movq %rdx, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
movq %rbx, %rdi
callq 0x52f5
movq %rax, %r15
movq 0x48(%r14), %rsi
leaq 0x1db(%rip), %rdx       # 0x548c
movq %rbx, %rdi
callq 0x5344
movq %r15, %rdi
callq 0xda8a
movq %rbx, %rdi
callq 0x52f5
movq %rax, %r15
movq 0x48(%r14), %rsi
leaq 0x1ce(%rip), %rdx       # 0x54a5
movq %rbx, %rdi
callq 0x5344
movq %r15, %rdi
callq 0xda8a
movq 0x8(%rbx), %rax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/integrity.c
// Function: attachDisposableRegion
static CR_Region *attachDisposableRegion(IntegrityCheckContext *ctx)
{
  CR_Region *disposable_r = CR_RegionNew();
  ctx->reusable_buffer_allocator =
    allocatorWrapOneSingleGrowableBuffer(disposable_r);
  ctx->unique_subpath_buffer = CR_RegionAllocGrowable(disposable_r, 1);
  ctx->unique_subpath_cache = strTableNew(disposable_r);
  ctx->unique_subpath_cache_key_allocator =
    allocatorWrapRegion(disposable_r);
  return disposable_r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0xd89c
movq %rax, %r14
movq %rax, %rdi
callq 0x2842
movq %rax, 0x28(%rbx)
movl $0x1, %esi
movq %r14, %rdi
callq 0xd5b8
movq %rax, 0x30(%rbx)
movq %r14, %rdi
callq 0xaf98
movq %rax, 0x38(%rbx)
movq %r14, %rdi
callq 0x2828
movq %rax, 0x40(%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/integrity.c
// Function: checkIntegrityRecursively
static void
checkIntegrityRecursively(IntegrityCheckContext *ctx,
                          const PathNode *node_list,
                          CheckFileCallback check_file_callback)
{
  for(const PathNode *node = node_list; node != NULL; node = node->next)
  {
    for(const PathHistory *point = node->history; point != NULL;
        point = point->next)
    {
      if(!historyPointIsHealthy(ctx, point, check_file_callback))
      {
        ListOfBrokenPathNodes *broken_node =
          CR_RegionAlloc(ctx->r, sizeof(*broken_node));
        broken_node->node = node;
        broken_node->next = ctx->broken_nodes;
        ctx->broken_nodes = broken_node;
        break;
      }
    }
    checkIntegrityRecursively(ctx, node->subnodes, check_file_callback);
  }
}

// Assembly:
testq %rsi, %rsi
je 0x548b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x30(%rdi), %r12
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x5461
cmpl $0x1, 0x8(%r13)
jne 0x543c
cmpq $0x15, 0x28(%r13)
jb 0x543c
leaq 0x18(%r13), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x758d
movq 0x30(%r15), %rsi
leaq 0x18(%rsp), %rdi
callq 0xab5c
movq 0x38(%r15), %rdi
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb15e
testq %rax, %rax
je 0x53d1
cmpq $0x1, %rax
je 0x543c
jmp 0x5445
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %rbp, %rsi
callq *%rbx
movl %eax, %ebp
movq 0x40(%r15), %rsi
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %rdi
callq 0xac37
movq 0x38(%r15), %rdi
movzbl %bpl, %ebp
movl $0x2, %esi
subq %rbp, %rsi
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xb043
testb %bpl, %bpl
je 0x5445
movq 0x48(%r13), %r13
jmp 0x536c
movq (%r15), %rdi
movl $0x10, %esi
callq 0xd960
movq %r14, (%rax)
movq 0x8(%r15), %rcx
movq %rcx, 0x8(%rax)
movq %rax, 0x8(%r15)
movq 0x28(%r14), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x5344
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x5368
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/integrity.c
// Function: storedFileIsHealthy
static bool storedFileIsHealthy(IntegrityCheckContext *ctx,
                                const RegularFileInfo *file_info,
                                StringView unique_subpath)
{
  StringView path_to_stored_file = strAppendPath(
    ctx->repo_path, unique_subpath, ctx->reusable_buffer_allocator);

  if(!sPathExists(path_to_stored_file))
  {
    callProgressCallback(ctx, file_info->size);
    return false;
  }

  const struct stat stats = sLStat(path_to_stored_file);
  if(!S_ISREG(stats.st_mode))
  {
    callProgressCallback(ctx, file_info->size);
    return false;
  }
  if((uint64_t)stats.st_size != file_info->size)
  {
    callProgressCallback(ctx, file_info->size);
    return false;
  }

  uint8_t hash[FILE_HASH_SIZE];
  fileHash(path_to_stored_file, stats, hash, fileHashCallback, ctx);
  return memcmp(file_info->hash, hash, FILE_HASH_SIZE) == 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x170, %rsp            # imm = 0x170
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %rsi
movq 0x1a0(%rsp), %rax
movq %rax, 0x28(%rsp)
movaps 0x190(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x20(%rdi), %rax
movq %rax, 0x10(%rsp)
movups 0x10(%rdi), %xmm0
movups %xmm0, (%rsp)
leaq 0xa8(%rsp), %r15
movq %r15, %rdi
callq 0xaf03
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movdqu (%r15), %xmm0
movdqu %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x55dc
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movdqu 0xa8(%rsp), %xmm0
movdqu %xmm0, (%rsp)
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
callq 0x8fc6
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x55dc
movq 0x10(%r14), %rdi
cmpq %rdi, 0x110(%rsp)
jne 0x5602
leaq 0x18(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movl $0x12, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq 0xb8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xa8(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x71(%rip), %rsi        # 0x560d
leaq 0xc0(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rdx
callq 0x3e50
movdqu 0x18(%r14), %xmm0
movd 0x28(%r14), %xmm1
movd 0x10(%r15), %xmm2
pcmpeqb %xmm1, %xmm2
pcmpeqb (%r15), %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %al
jmp 0x55f5
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x55f3
movq 0x10(%r14), %rdi
movq 0x48(%rbx), %rsi
movq 0x58(%rbx), %rdx
callq *%rax
xorl %eax, %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbx
popq %r14
popq %r15
retq
movq 0x50(%rbx), %rax
testq %rax, %rax
jne 0x55e9
jmp 0x55f3
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/metadata.c
// Function: metadataNew
Metadata *metadataNew(CR_Region *r)
{
  Metadata *metadata = CR_RegionAlloc(r, sizeof *metadata);
  metadata->r = r;

  metadata->current_backup.id = 0;
  metadata->current_backup.completion_time = 0;
  metadata->current_backup.ref_count = 0;

  metadata->backup_history_length = 0;
  metadata->backup_history = NULL;

  metadata->config_history = NULL;

  metadata->total_path_count = 0;
  metadata->path_table = strTableNew(metadata->r);
  metadata->paths = NULL;

  return metadata;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x50, %esi
callq 0xd960
movq %rax, %r14
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x28(%rax)
xorl %r15d, %r15d
movq %r15, 0x38(%rax)
movq %rbx, %rdi
callq 0xaf98
movq %rax, 0x40(%r14)
movq %r15, 0x48(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/metadata.c
// Function: readFullPathHistory
static PathHistory *readFullPathHistory(Allocator *region_wrapper,
                                        const FileContent content,
                                        size_t *reader_position,
                                        StringView metadata_path,
                                        Metadata *metadata)
{
  const size_t history_length =
    readSize(content, reader_position, metadata_path);

  if(history_length == 0)
  {
    return NULL;
  }

  PathHistory *first_point = readPathHistory(
    region_wrapper, content, reader_position, metadata_path, metadata);
  PathHistory *current_point = first_point;

  for(size_t counter = 1; counter < history_length; counter++)
  {
    current_point->next = readPathHistory(
      region_wrapper, content, reader_position, metadata_path, metadata);
    current_point = current_point->next;
  }

  return first_point;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
movq (%rcx), %rdi
movl $0x8, %esi
movq %r8, %rcx
movq %r9, 0x8(%rsp)
movq %r9, %r8
callq 0x615b
movq (%r15), %rax
movq (%r13,%rax), %rbp
addq $0x8, %rax
movq %rax, (%r15)
testq %rbp, %rbp
je 0x5920
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %rbx, 0x18(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
movq 0x8(%rsp), %r9
callq 0x61ba
cmpq $0x1, %rbp
je 0x5922
decq %rbp
movq %r14, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movq %rax, %rbx
movq 0x18(%rsp), %r14
movq 0x60(%rsp), %rax
movq %rax, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq 0x20(%rsp), %r8
movq 0x8(%rsp), %r9
callq 0x61ba
movq %rax, 0x48(%rbx)
movq %rax, %rbx
decq %rbp
jne 0x58e9
movq 0x10(%rsp), %rax
jmp 0x5922
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
testq %rdi, %rdi
je 0x6133
movq %rdi, %r14
xorl %eax, %eax
movl $0x1ff, %ebp            # imm = 0x1FF
movq %rdi, %r15
movl 0x18(%r15), %ecx
andl %ebp, %ecx
cmpl $0x4, %ecx
je 0x606e
movl $0x1, %esi
movq %rax, %rdi
callq 0x8778
movq 0x30(%r15), %r15
testq %r15, %r15
jne 0x6056
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
movl $0x8, %esi
movq %rbx, %rdx
callq 0x79d8
testq %r14, %r14
je 0x614c
movl $0x1ff, %r15d           # imm = 0x1FF
leaq 0x20(%rsp), %r12
movl 0x18(%r14), %eax
andl %r15d, %eax
cmpl $0x4, %eax
je 0x6124
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
leaq 0x28(%rsp), %rdi
callq 0xacd5
movq 0x40(%rsp), %r13
movq 0x48(%rsp), %rbp
movq %rbp, 0x20(%rsp)
movl $0x8, %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x79d8
movq %r13, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x79d8
movb 0x1c(%r14), %al
movb %al, 0x20(%rsp)
movl $0x1, %esi
movq %r12, %rdi
movq %rbx, %rdx
callq 0x79d8
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x5e39
movq 0x28(%r14), %rdi
movq %rbx, %rsi
callq 0x602f
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x60a0
jmp 0x614c
leaq 0x20(%rsp), %rdi
movq $0x0, (%rdi)
movl $0x8, %esi
movq %rbx, %rdx
callq 0x79d8
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6f2a
movl $0xa, %edi
callq 0x2050
leaq 0x50(%rsp), %r14
movq 0xc09a(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
callq 0x9818
testb %al, %al
je 0x6f73
movl $0xa, %edi
callq 0x2050
leaq 0x77a4(%rip), %r8       # 0xe6f7
leaq 0x77ba(%rip), %r9       # 0xe714
movl $0x64, %edx
xorl %edi, %edi
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x7367
leaq 0x382(%rip), %rsi       # 0x72f3
jmp 0x6f75
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 0x3f75
movq %rdx, %rcx
leaq 0x7754(%rip), %r8       # 0xe6f7
leaq 0x776a(%rip), %r9       # 0xe714
movl $0x64, %edx
movl $0x1, %edi
xorl %esi, %esi
callq 0x7367
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xac98
leaq 0x71ea(%rip), %rsi      # 0xe1e9
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0xab5c
movq %rbx, %rdi
callq 0x2828
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 0xaf03
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x70a4
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x7cb2
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x566b
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xa0(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x7697(%rip), %rdi      # 0xe750
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/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 0x70e8
leaq 0x736b(%rip), %rdi      # 0xe44a
xorl %eax, %eax
callq 0x2150
jmp 0x70ec
movb $0x1, (%r8)
leaq 0x71d7(%rip), %rdi      # 0xe2ca
movq %r15, %rsi
xorl %eax, %eax
callq 0x2150
movq 0xbecc(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
leaq 0x7379(%rip), %rdx      # 0xe487
movl %ebp, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x3bbc
leaq 0x7616(%rip), %rdi      # 0xe737
xorl %eax, %eax
callq 0x2150
movq %rbx, %rdi
callq 0x435c
movl $0x29, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/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 0xbe76(%rip), %rbp      # 0x12fd8
leaq 0x30(%rsp), %r13
leaq 0x798f(%rip), %r15      # 0xeafd
leaq 0x60(%rsp), %r12
leaq 0x756a(%rip), %rdi      # 0xe6e4
movq %r14, %rsi
xorl %eax, %eax
callq 0x2150
movq (%rbp), %rdi
callq 0x9818
testb %al, %al
jne 0x719b
movl $0xa, %edi
callq 0x2050
movq %r13, %rdi
leaq 0x75fa(%rip), %rsi      # 0xe79f
callq 0xab5c
movq (%rbp), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x96ee
testb %al, %al
je 0x72e9
leaq 0x90(%rsp), %rdi
leaq 0x751e(%rip), %rsi      # 0xe6ee
callq 0xab5c
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 0xad56
testb %al, %al
jne 0x72e9
leaq 0x78(%rsp), %rdi
leaq 0x74d5(%rip), %rsi      # 0xe6f0
callq 0xab5c
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 0xad56
testb %al, %al
jne 0x72e9
movq %r12, %rdi
movq %r15, %rsi
callq 0xab5c
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 0xad56
testb %al, %al
jne 0x72d7
leaq 0x48(%rsp), %rdi
leaq 0x7455(%rip), %rsi      # 0xe6f3
callq 0xab5c
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 0xad56
testb %al, %al
je 0x7173
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_O3/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 0x7335
testb %al, %al
je 0x732c
movq (%rbx), %rsi
leaq 0x73df(%rip), %r8       # 0xe6f7
leaq 0x73f5(%rip), %r9       # 0xe714
xorl %edi, %edi
movq %r15, %rdx
movq %r14, %rcx
callq 0x7367
incq (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x9915
movq %rax, %r14
movq (%rbx), %rdi
movq %rax, %rsi
callq 0x87f0
cmpq $0x33, %rax
jb 0x7358
movq %r14, (%rbx)
cmpq $0x33, %rax
setae %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xbc45(%rip), %rbx      # 0x12fd0
movq (%rbx), %rdi
callq 0x9818
testb %al, %al
je 0x73a5
leaq 0x73a9(%rip), %rdi      # 0xe747
xorl %eax, %eax
callq 0x2150
leaq 0x7370(%rip), %rdi      # 0xe71c
movq %r13, %rsi
xorl %eax, %eax
callq 0x2150
testb %bpl, %bpl
je 0x73da
movq (%rbx), %rdi
leaq 0x735e(%rip), %rdx      # 0xe723
movl $0x1, %esi
xorl %eax, %eax
callq 0x3bbc
leaq 0x735f(%rip), %rdi      # 0xe737
jmp 0x7432
cmpq %r15, %r12
jae 0x742b
testq %r12, %r12
je 0x7461
movl $0x3e8, %esi            # imm = 0x3E8
movq %r12, %rdi
callq 0x87cc
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 0x731e(%rip), %rdi      # 0xe73a
movq %rdx, %rsi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x2150
jmp 0x7439
leaq 0x72ff(%rip), %rdi      # 0xe731
xorl %eax, %eax
callq 0x2150
movq %r14, %rdi
callq 0x435c
leaq 0x72e3(%rip), %rdi      # 0xe72b
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_O3/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 0x87b4
movq %rax, (%r14)
movq 0xbb38(%rip), %rax      # 0x12fd0
movq (%rax), %rdi
callq 0x9818
testb %al, %al
je 0x74d6
leaq 0x8(%r14), %rdi
callq 0x7335
testb %al, %al
je 0x74d6
movq (%r14), %rcx
leaq 0x731a(%rip), %r8       # 0xe7d5
leaq 0x7326(%rip), %r9       # 0xe7e8
xorl %edi, %edi
movq %rcx, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x7367
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x75bc
leaq 0x1(%rax), %rdi
movq %r14, %rsi
callq 0x8778
movq 0xbcfe(%rip), %rdi      # 0x13250
movq %rax, %rsi
callq 0xd64e
movq %rax, %r12
movq %rax, 0xbcec(%rip)      # 0x13250
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2280
leaq (%r12,%r14), %rdi
incq %rdi
movb $0x2f, -0x1(%rdi)
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x75ff
// File: /workspace/github_c_makefile_star2_O3/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 0x735f(%rip), %r15      # 0xe978
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 0x7655
addq $0x2a, %rbx
movq 0x10(%r14), %rdx
movzbl 0x2c(%r14), %ecx
leaq 0x72f8(%rip), %rsi      # 0xe97d
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x23b0
// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rdx
leaq 0x58(%rsp), %r12
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7526
movq 0xbb89(%rip), %rdi      # 0x13250
leaq 0x7139(%rip), %rsi      # 0xe807
callq 0x2370
testq %rax, %rax
je 0x7735
movq %rax, %r14
leaq 0x40(%rsp), %r15
movl $0x38, %edi
callq 0x8804
movq %rax, %rbx
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xac25
leaq 0x18(%rbx), %rdi
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0xac25
movq %r14, 0x30(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x70c5(%rip), %rdi      # 0xe80a
movl %r15d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 0x778b
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 0x77ee
leaq 0x708f(%rip), %rdi      # 0xe867
movl %r12d, %esi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x3d70
leaq 0x7035(%rip), %rdi      # 0xe82a
movl %r12d, %esi
movq %r14, %rdx
movl 0xc(%rsp), %ecx
movq 0x10(%rsp), %r8
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/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 0x7842
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x7048(%rip), %rdi      # 0xe891
movl %r12d, %esi
movq %r15, %rdx
movl %r14d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 0x8979
movq %rax, %r14
movl $0x70, %edi
callq 0x8804
movq %rax, %r15
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xac25
leaq 0x18(%r15), %rdi
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x58(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xac25
leaq 0x30(%r15), %rdi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xac25
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_O3/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 0x8aff
testb %al, %al
je 0x79f9
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 0x8c06
movq %rbx, %rdi
callq 0x2040
leaq 0x6e93(%rip), %rdi      # 0xe8b2
movl %r12d, %esi
movq %r15, %rdx
movl %ebp, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 0x2828
movq %rax, %r12
movl $0x10, %esi
movq %r15, %rdi
callq 0xd960
movq %rax, %r14
movb $0x0, (%rax)
leaq 0x64fc(%rip), %rsi      # 0xe1f2
leaq 0x38(%rsp), %r13
movq %r13, %rdi
callq 0xab5c
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 0xaf03
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
callq 0xab87
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 0x7da6
leaq 0x7b(%rip), %rsi        # 0x7dfc
movq %r15, %rdi
movq %r14, %rdx
callq 0xda39
movl 0x4(%r14), %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x2180
testl %eax, %eax
jne 0x7dc3
movb $0x1, (%r14)
jmp 0x7db4
cmpl $0x1, 0x34(%rsp)
jne 0x7ddd
cmpl $0x1e, (%rbx)
jne 0x7ddd
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 0x7dcf
cmpl $0xb, %eax
jne 0x7dea
leaq 0x6b4a(%rip), %rdi      # 0xe920
xorl %eax, %eax
callq 0x3ca8
movq 0x8(%r14), %rsi
leaq 0x6b18(%rip), %rdi      # 0xe900
jmp 0x7df5
movq 0x8(%r14), %rsi
leaq 0x6b5f(%rip), %rdi      # 0xe954
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 0x7e34
xorl %esi, %esi
xorl %edx, %edx
callq 0x2180
movl 0x4(%r14), %edi
callq 0x21c0
movq 0x8(%r14), %rdi
callq 0x2080
jmp 0x7e39
callq 0x21c0
movl %ebp, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2828
movq %rax, 0x20(%rsp)
movq (%r14), %rdi
callq 0x2842
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xad4c
movq 0x48(%r14), %r14
testb %al, %al
je 0x7eda
testq %r14, %r14
je 0x7f04
leaq 0x20(%rsp), %r15
movq 0x20(%r14), %rdx
cmpl $0x3, 0x1c(%r14)
jne 0x7eb1
testq %rdx, %rdx
je 0x7ecf
movq (%rdx), %rax
cmpq %rbx, (%rax)
jae 0x7eb1
movq 0x48(%rdx), %rdx
jmp 0x7e9e
cmpl $0x0, 0x8(%rdx)
je 0x7ecf
addq $0x8, %rdx
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x7f0e
movq 0x30(%r14), %r14
testq %r14, %r14
jne 0x7e93
jmp 0x7f04
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 0x7fa0
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq