// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/nb.c
// Function: runIntegrityCheck
static void runIntegrityCheck(const Metadata *metadata,
                              StringView repo_path)
{
  CR_Region *r = CR_RegionNew();
  if(sIsTTY(stdout))
  {
    printf("\n");
    printIntegrityProgress(false, 0, 100);
  }

  IntegrityProgressContext ctx = { 0 };
  const ListOfBrokenPathNodes *broken_nodes = checkIntegrity(
    r, metadata, repo_path, integrityProgressCallback, &ctx);
  printIntegrityProgress(true, ctx.bytes_processed, ctx.bytes_processed);

  printf("Status of repository: ");
  if(broken_nodes == NULL)
  {
    colorPrintf(stdout, TC_green_bold, "Healthy\n");
  }
  else
  {
    colorPrintf(stdout, TC_red_bold, "Incomplete\n\n");
  }

  size_t broken_node_count = 0;
  for(const ListOfBrokenPathNodes *path_node = broken_nodes;
      path_node != NULL; path_node = path_node->next)
  {
    colorPrintf(stdout, TC_red_bold, "?? ");
    colorPrintf(stdout, TC_red, "" PRI_STR " ",
                STR_FMT(path_node->node->path));
    printf("(corrupted)\n");
    broken_node_count++;
  }
  CR_RegionRelease(r);

  if(broken_node_count != 0)
  {
    printf("\n");
    die("found %li item%s with corrupted backup history",
        broken_node_count, broken_node_count == 1 ? "" : "s");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
callq 0x22f30
movq %rax, -0x10(%rbp)
movq 0x2004c(%rip), %rax     # 0x28fc0
movq (%rax), %rdi
callq 0xd290
testb $0x1, %al
jne 0x8f82
jmp 0x8fa0
leaq 0x1b820(%rip), %rdi     # 0x247a9
movb $0x0, %al
callq 0x2130
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
movl $0x64, %edx
callq 0x97a0
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2170
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x82d(%rip), %rdx       # 0x97f0
leaq -0x20(%rbp), %rcx
movq (%rax), %r8
movq %r8, (%rsp)
movq 0x8(%rax), %r8
movq %r8, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x6630
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x1, %edi
callq 0x97a0
leaq 0x1b77c(%rip), %rdi     # 0x2477e
movb $0x0, %al
callq 0x2130
cmpq $0x0, -0x28(%rbp)
jne 0x902f
movq 0x1ffa9(%rip), %rax     # 0x28fc0
movq (%rax), %rdi
movl $0x5, %esi
leaq 0x1b76f(%rip), %rdx     # 0x24795
movb $0x0, %al
callq 0x4590
jmp 0x904c
movq 0x1ff8a(%rip), %rax     # 0x28fc0
movq (%rax), %rdi
movl $0x3, %esi
leaq 0x1b759(%rip), %rdx     # 0x2479e
movb $0x0, %al
callq 0x4590
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x90dc
movq 0x1ff56(%rip), %rax     # 0x28fc0
movq (%rax), %rdi
movl $0x3, %esi
leaq 0x1b275(%rip), %rdx     # 0x242ee
movb $0x0, %al
callq 0x4590
movq 0x1ff39(%rip), %rax     # 0x28fc0
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq (%rax), %r8
movl $0x2, %esi
leaq 0x1b6fe(%rip), %rdx     # 0x247ab
movb $0x0, %al
callq 0x4590
leaq 0x1b6f6(%rip), %rdi     # 0x247b1
movb $0x0, %al
callq 0x2130
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x905c
movq -0x10(%rbp), %rdi
callq 0x23370
cmpq $0x0, -0x30(%rbp)
je 0x9126
leaq 0x1b6b6(%rip), %rdi     # 0x247a9
movb $0x0, %al
callq 0x2130
movq -0x30(%rbp), %rsi
movq -0x30(%rbp), %rcx
leaq 0x1b30a(%rip), %rdx     # 0x24413
leaq 0x1b69a(%rip), %rax     # 0x247aa
cmpq $0x1, %rcx
cmoveq %rax, %rdx
leaq 0x1b69f(%rip), %rdi     # 0x247be
movb $0x0, %al
callq 0x4680
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)