// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/garbage-collector.c
// Function: collectGarbageProgress
GCStatistics collectGarbageProgress(const Metadata *metadata,
                                    StringView repo_path,
                                    GCProgressCallback progress_callback,
                                    void *callback_user_data)
{
  CR_Region *r = CR_RegionNew();

  GCContext ctx = {
    .repo_path = repo_path,
    .paths_to_preserve = strTableNew(r),
    .progress_callback = progress_callback,
    .callback_user_data = callback_user_data,
  };
  strTableMap(ctx.paths_to_preserve, str("config"), (void *)0x1);
  strTableMap(ctx.paths_to_preserve, str("metadata"), (void *)0x1);
  strTableMap(ctx.paths_to_preserve, str("lockfile"), (void *)0x1);
  populateTableRecursively(allocatorWrapRegion(r), ctx.paths_to_preserve,
                           metadata->paths);

  DirIterator *dir = sDirOpen(repo_path);
  for(StringView subpath = sDirGetNext(dir); !strIsEmpty(subpath);
      strSet(&subpath, sDirGetNext(dir)))
  {
    sRemoveRecursivelyIf(subpath, shouldBeRemoved, &ctx);
  }
  sDirClose(dir);

  CR_RegionRelease(r);
  return ctx.statistics;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
leaq 0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
callq 0x22f30
movq %rax, %rcx
movq -0xf8(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq (%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x68(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
callq 0xf830
movq %rax, -0x58(%rbp)
leaq -0x70(%rbp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2170
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x88(%rbp), %rdi
leaq 0x1f6f1(%rip), %rsi     # 0x241b7
callq 0xf100
movq -0x110(%rbp), %rdi
leaq -0x88(%rbp), %rax
movl $0x1, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf940
movq -0x58(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0xa0(%rbp), %rdi
leaq 0x1f6a9(%rip), %rsi     # 0x241be
callq 0xf100
movq -0x108(%rbp), %rdi
leaq -0xa0(%rbp), %rax
movl $0x1, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf940
movq -0x58(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq -0xb8(%rbp), %rdi
leaq 0x1f663(%rip), %rsi     # 0x241c7
callq 0xf100
movq -0x100(%rbp), %rdi
leaq -0xb8(%rbp), %rax
movl $0x1, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf940
movq -0x30(%rbp), %rdi
callq 0x25a0
movq %rax, %rdi
movq -0x58(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
callq 0x4cd0
movq -0xf8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc0f0
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0xc220
leaq -0xd8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf4a0
xorb $-0x1, %al
testb $0x1, %al
jne 0x4c23
jmp 0x4c97
leaq -0xd8(%rbp), %rax
leaq 0x20f(%rip), %rdi       # 0x4e40
leaq -0x70(%rbp), %rsi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xcd10
movq -0xc0(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0xc220
leaq -0xd8(%rbp), %rdi
leaq -0xf0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf240
jmp 0x4bf6
movq -0xc0(%rbp), %rdi
callq 0xc3a0
movq -0x30(%rbp), %rdi
callq 0x23370
movups -0x50(%rbp), %xmm0
movaps %xmm0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopw %cs:(%rax,%rax)