// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/integrity.c
// Function: historyPointIsHealthy
static bool historyPointIsHealthy(IntegrityCheckContext *ctx,
                                  const PathHistory *point,
                                  CheckFileCallback check_file_callback)
{
  if(point->state.type != PST_regular_file)
  {
    return true;
  }

  const RegularFileInfo *file_info = &point->state.metadata.file_info;
  if(file_info->size <= FILE_HASH_SIZE)
  {
    return true;
  }

  repoBuildRegularFilePath(&ctx->unique_subpath_buffer, file_info);
  StringView unique_subpath = str(ctx->unique_subpath_buffer);

  const void *cached_result =
    strTableGet(ctx->unique_subpath_cache, unique_subpath);
  void *subpath_is_healthy = (void *)0x1;
  void *subpath_is_broken = (void *)0x2;

  if(cached_result == NULL)
  {
    const bool is_healthy =
      check_file_callback(ctx, file_info, unique_subpath);
    StringView key_copy =
      strCopy(unique_subpath, ctx->unique_subpath_cache_key_allocator);
    strTableMap(ctx->unique_subpath_cache, key_copy,
                is_healthy ? subpath_is_healthy : subpath_is_broken);
    return is_healthy;
  }
  return cached_result == subpath_is_healthy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x8(%rax)
je 0x6a8a
movb $0x1, -0x1(%rbp)
jmp 0x6bea
movq -0x18(%rbp), %rax
addq $0x8, %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x14, 0x10(%rax)
ja 0x6aae
movb $0x1, -0x1(%rbp)
jmp 0x6bea
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
movq -0x28(%rbp), %rsi
callq 0x9a70
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0xf100
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
leaq -0x40(%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 0xfb50
movq %rax, -0x48(%rbp)
movl $0x1, %eax
movq %rax, -0x50(%rbp)
movl $0x2, %eax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x6bda
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x40(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
callq *%rax
andb $0x1, %al
movb %al, -0x59(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
leaq -0x78(%rbp), %rdi
leaq -0x40(%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 0xf270
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x80(%rbp)
testb $0x1, -0x59(%rbp)
je 0x6b98
movq -0x50(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x6ba3
movq -0x58(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
leaq -0x78(%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 0xf940
movb -0x59(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x6bea
movq -0x48(%rbp), %rax
cmpq -0x50(%rbp), %rax
sete %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)