LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movl $0x1, %esi
callq 0x20a0
cmpq -0x10(%rbp), %rax
je 0x9e21
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x20(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2240
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x49(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x20e0
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
callq 0x2050
movl -0x54(%rbp), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x2040
testb $0x1, -0x49(%rbp)
je 0x9dff
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %r8
leaq 0x1aa3e(%rip), %rdi     # 0x24836
movb $0x0, %al
callq 0x4680
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %r8
leaq 0x1aa59(%rip), %rdi     # 0x24873
movb $0x0, %al
callq 0x4760
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movl $0x38, %edx
callq 0x2250
movq -0x8(%rbp), %rdi
callq 0x2040
movq -0x10(%rbp), %rdi
callq 0x20e0
cmpl $0x0, %eax
je 0x9e87
movq -0x20(%rbp), %rax
movl %eax, %esi
movq -0x28(%rbp), %rdx
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %r8
leaq 0x1aa1d(%rip), %rdi     # 0x2489d
movb $0x0, %al
callq 0x4760
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dil, %cl
leaq 0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x10(%rbp), %rdx
movq %rdx, -0x30(%rbp)
andb $0x1, %cl
movb %cl, -0x1(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbcf0
movq %rax, -0x10(%rbp)
movl $0x70, %edi
callq 0xba70
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf240
movq -0x28(%rbp), %rax
movq -0x18(%rbp), %rdi
addq $0x18, %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf240
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf240
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x48(%rax)
movb -0x1(%rbp), %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x50(%rax)
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdx
callq 0xbf00
testb $0x1, %al
jne 0xa16c
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rcx
movq %rcx, -0x48(%rbp)
movq 0x38(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x40(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0xc080
movq -0x18(%rbp), %rdi
callq 0x2040
movq -0x40(%rbp), %rax
movl %eax, %esi
movq -0x48(%rbp), %rdx
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x30(%rbp), %r8
leaq 0x1a759(%rip), %rdi     # 0x248be
movb $0x0, %al
callq 0x4760
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
testb $0x1, (%rax)
je 0xa734
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2160
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x21a0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2070
jmp 0xa740
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x21a0
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
callq 0x2050
movl -0x18(%rbp), %ecx
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x25a0
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x25e0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xf4a0
testb $0x1, %al
jne 0xa7c3
jmp 0xa81b
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xa819
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa860
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xa809
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x1, %r8d
callq 0xa8b0
jmp 0xa80b
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xa7cf
jmp 0xa852
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x48(%rcx), %rsi
movq -0x10(%rbp), %rdx
leaq -0x20(%rbp), %rdi
movl $0x1, %ecx
movq (%rax), %r8
movq %r8, (%rsp)
movq 0x8(%rax), %r8
movq %r8, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xa980
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/restore.c
// Function: searchExistingPathState
static const PathState *searchExistingPathState(const PathNode *node,
                                                const size_t id)
{
  const PathState *state = searchPathState(node, id);

  if(state != NULL && state->type == PST_non_existing)
  {
    state = NULL;
  }

  return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xb270
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa899
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
jne 0xa899
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0xb2f0
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
je 0xa8f4
jmp 0xa973
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0x2, %eax
jb 0xa91a
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0xd, %eax
ja 0xa91a
movb $0x0, -0x21(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xa973
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa860
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xa963
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x20(%rbp), %rcx
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %r8d
callq 0xa8b0
jmp 0xa965
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xa926
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1080, %rsp           # imm = 0x1080
leaq 0x28(%rbp), %rax
movq %rax, -0x1040(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x1038(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x14, 0x10(%rax)
jbe 0xad08
movq -0x1038(%rbp), %rax
movq -0x1040(%rbp), %rcx
movq -0x8(%rbp), %rdi
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x9c20
movq %rax, %rcx
movq -0x1038(%rbp), %rax
movq %rcx, -0x10(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbcf0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jbe 0xacf4
cmpq $0x1000, -0x20(%rbp)    # imm = 0x1000
jbe 0xac99
movl $0x1000, %eax           # imm = 0x1000
movq %rax, -0x1048(%rbp)
jmp 0xaca4
movq -0x20(%rbp), %rax
movq %rax, -0x1048(%rbp)
movq -0x1048(%rbp), %rax
movq %rax, -0x1028(%rbp)
leaq -0x1020(%rbp), %rdi
movq -0x1028(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x9d20
leaq -0x1020(%rbp), %rdi
movq -0x1028(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xbea0
movq -0x1028(%rbp), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0xac7a
movq -0x10(%rbp), %rdi
callq 0x9e30
movq -0x18(%rbp), %rdi
callq 0xc020
jmp 0xad5c
movq -0x1038(%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 0xbcf0
movq %rax, -0x1030(%rbp)
movq -0x8(%rbp), %rdi
addq $0x18, %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x1030(%rbp), %rdx
callq 0xbea0
movq -0x1030(%rbp), %rdi
callq 0xc020
addq $0x1080, %rsp           # imm = 0x1080
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/restore.c
// Function: searchPathState
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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3, 0x1c(%rax)
je 0xb298
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0xb2e1
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xb2d9
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
cmpq -0x18(%rbp), %rax
jb 0xb2c9
movq -0x20(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0xb2e1
jmp 0xb2cb
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0xb2a4
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
je 0xb445
movq -0x10(%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 0xc4d0
testb $0x1, %al
jne 0xb343
jmp 0xb445
movq -0x18(%rbp), %rax
cmpl $0x2, (%rax)
jne 0xb377
movq -0x10(%rbp), %rax
leaq -0xb0(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc670
jmp 0xb3a0
movq -0x10(%rbp), %rax
leaq -0xb0(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc5a0
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
movq %rsp, %rdi
movl $0x12, %ecx
leaq -0xb0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x100(%rbp), %rsi
movq -0xf8(%rbp), %rdi
callq 0xb470
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1ff, %eax            # imm = 0x1FF
cmpl $0x0, %eax
jne 0xb443
movq -0x18(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
movl $0x40, %edx
callq 0x2250
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movq %rsp, %rdi
movl $0x12, %ecx
leaq -0xb0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdi
leaq -0xf0(%rbp), %rdx
callq 0x2640
jmp 0xb45c
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
andl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
orl $0x2, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xa860
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xb697
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq 0x19361(%rip), %rdi     # 0x249f1
movb $0x0, %al
callq 0x4680
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbba0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, -0x8(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
leaq 0x18ce2(%rip), %rsi     # 0x24813
callq 0x2330
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xbb73
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x23370
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x18f29(%rip), %rdi     # 0x24a95
movb $0x0, %al
callq 0x4760
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x11b(%rip), %rsi       # 0xbca0
callq 0x232e0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x22f30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x28, %esi
callq 0x230e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x25a0
movq %rax, %rsi
movq -0x38(%rbp), %rax
leaq -0x28(%rbp), %rdi
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 -0x30(%rbp), %rdi
leaq -0x28(%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
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xbcc1
jmp 0xbce8
callq 0x2050
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x20e0
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
callq 0x2050
movl -0x18(%rbp), %ecx
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sFopenWrite
FileStream *sFopenWrite(StringView path)
{
  FileStream *result = newFileStream(path);
  result->handle = fopen(nullTerminate(path), "wb");
  if(result->handle == NULL)
  {
    CR_RegionRelease(result->r);
    dieErrno("failed to open \"" PRI_STR "\" for writing", STR_FMT(path));
  }
  CR_RegionAttach(result->r, closeFileHandle, result);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbba0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, -0x8(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
leaq 0x18d66(%rip), %rsi     # 0x24ab7
callq 0x2330
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0xbd93
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x23370
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x18d2e(%rip), %rdi     # 0x24aba
movb $0x0, %al
callq 0x4760
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq -0x105(%rip), %rsi      # 0xbca0
callq 0x232e0
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sFread
void sFread(void *ptr, const size_t size, FileStream *stream)
{
  if(fread(ptr, 1, size, stream->handle) != size)
  {
    if(feof(stream->handle))
    {
      die("reading \"%s\": reached end of file unexpectedly",
          internalFDestroy(stream));
    }
    else
    {
      dieErrno("IO error while reading \"%s\"", internalFDestroy(stream));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rcx
movl $0x1, %esi
callq 0x20a0
cmpq -0x10(%rbp), %rax
je 0xbe3a
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2240
cmpl $0x0, %eax
je 0xbe20
movq -0x18(%rbp), %rdi
callq 0xbe40
movq %rax, %rsi
leaq 0x18cc3(%rip), %rdi     # 0x24adc
movb $0x0, %al
callq 0x4680
movq -0x18(%rbp), %rdi
callq 0xbe40
movq %rax, %rsi
leaq 0x18cd8(%rip), %rdi     # 0x24b0b
movb $0x0, %al
callq 0x4760
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: fDatasync
void fDatasync(StringView path)
{
  const int dir_descriptor = open(nullTerminate(path), O_RDONLY, 0);
  if(dir_descriptor == -1 || fdatasync(dir_descriptor) != 0 ||
     close(dir_descriptor) != 0)
  {
    dieErrno("failed to sync path to device: \"" PRI_STR "\"",
             STR_FMT(path));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
xorl %edx, %edx
movl %edx, %esi
movb $0x0, %al
callq 0x2320
movl %eax, -0x4(%rbp)
cmpl $-0x1, -0x4(%rbp)
je 0xbfff
movl -0x4(%rbp), %edi
callq 0x2060
cmpl $0x0, %eax
jne 0xbfff
movl -0x4(%rbp), %edi
callq 0x21a0
cmpl $0x0, %eax
je 0xc01a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x18b2c(%rip), %rdi     # 0x24b3f
movb $0x0, %al
callq 0x4760
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sFclose
void sFclose(FileStream *stream)
{
  FILE *handle = stream->handle;
  stream->handle = NULL;
  const char *path = internalFDestroy(stream);

  if(fclose(handle) != 0)
  {
    dieErrno("failed to close \"%s\"", path);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x8(%rbp), %rdi
callq 0xbe40
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20e0
cmpl $0x0, %eax
je 0xc071
movq -0x18(%rbp), %rsi
leaq 0x18afb(%rip), %rdi     # 0x24b65
movb $0x0, %al
callq 0x4760
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: closeDirHandle
void closeDirHandle(void *data)
{
  DirIterator *dir = data;
  if(dir->handle == NULL) return;

  const int old_errno = errno;
  (void)closedir(dir->handle);
  errno = old_errno;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0xc0c1
jmp 0xc0e8
callq 0x2050
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x21b0
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
callq 0x2050
movl -0x18(%rbp), %ecx
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sDirOpen
DirIterator *sDirOpen(StringView path)
{
  CR_Region *r = CR_RegionNew();
  DirIterator *dir = CR_RegionAlloc(r, sizeof *dir);

  dir->r = r;
  strSet(&dir->directory_path, strCopy(path, allocatorWrapRegion(r)));
  dir->returned_result_buffer = allocatorWrapOneSingleGrowableBuffer(r);
  dir->handle = opendir(nullTerminate(path));

  if(dir->handle == NULL)
  {
    CR_RegionRelease(r);
    dieErrno("failed to open directory \"" PRI_STR "\"", STR_FMT(path));
  }
  CR_RegionAttach(r, closeDirHandle, dir);

  return dir;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x22f30
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x30, %esi
callq 0x230e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x25a0
movq %rax, %rsi
movq -0x30(%rbp), %rax
leaq -0x28(%rbp), %rdi
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 -0x38(%rbp), %rdi
leaq -0x28(%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
movq -0x8(%rbp), %rdi
callq 0x25e0
movq %rax, %rdx
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rdx, 0x20(%rcx)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0xc202
movq -0x8(%rbp), %rdi
callq 0x23370
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x1897f(%rip), %rdi     # 0x24b7a
movb $0x0, %al
callq 0x4760
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x171(%rip), %rsi      # 0xc0a0
callq 0x232e0
movq -0x10(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sDirGetNext
StringView sDirGetNext(DirIterator *dir)
{
  struct dirent *dir_entry;
  const int old_errno = errno;
  errno = 0;

  do
  {
    dir_entry = readdir(dir->handle);

    if(dir_entry == NULL && errno != 0)
    {
      dieErrno("failed to read directory \"" PRI_STR "\"",
               STR_FMT(dir->directory_path));
    }
  } while(dir_entry != NULL && dir_entry->d_name[0] == '.' &&
          (dir_entry->d_name[1] == '\0' ||
           (dir_entry->d_name[1] == '.' && dir_entry->d_name[2] == '\0')));

  errno = old_errno;
  if(dir_entry == NULL)
  {
    return str("");
  }

  return strAppendPath(dir->directory_path, str(dir_entry->d_name),
                       dir->returned_result_buffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movq %rsi, -0x8(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0x14(%rbp)
callq 0x2050
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2290
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xc28e
callq 0x2050
cmpl $0x0, (%rax)
je 0xc28e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x18913(%rip), %rdi     # 0x24b9a
movb $0x0, %al
callq 0x4760
jmp 0xc290
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x41(%rbp)
je 0xc2ef
movq -0x10(%rbp), %rax
movsbl 0x13(%rax), %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, -0x41(%rbp)
jne 0xc2ef
movq -0x10(%rbp), %rax
movsbl 0x14(%rax), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x42(%rbp)
je 0xc2e9
movq -0x10(%rbp), %rax
movsbl 0x14(%rax), %ecx
xorl %eax, %eax
cmpl $0x2e, %ecx
movb %al, -0x43(%rbp)
jne 0xc2e3
movq -0x10(%rbp), %rax
movsbl 0x15(%rax), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x43(%rbp)
movb -0x43(%rbp), %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0xc24c
movl -0x14(%rbp), %eax
movl %eax, -0x48(%rbp)
callq 0x2050
movl -0x48(%rbp), %ecx
movl %ecx, (%rax)
cmpq $0x0, -0x10(%rbp)
jne 0xc323
movq -0x40(%rbp), %rdi
leaq 0x1848e(%rip), %rsi     # 0x247aa
callq 0xf100
jmp 0xc38c
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rsi
addq $0x13, %rsi
leaq -0x30(%rbp), %rdi
callq 0xf100
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0xf750
movq -0x38(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sDirClose
void sDirClose(DirIterator *dir)
{
  DIR *handle = dir->handle;
  dir->handle = NULL;

  if(closedir(handle) != 0)
  {
    dieErrno("failed to close directory \"" PRI_STR "\"",
             STR_FMT(dir->directory_path));
  }
  CR_RegionRelease(dir->r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rdi
callq 0x21b0
cmpl $0x0, %eax
je 0xc3f2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x187cf(%rip), %rdi     # 0x24bba
movb $0x0, %al
callq 0x4760
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x23370
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sFbytesLeft
bool sFbytesLeft(FileStream *stream)
{
  const int old_errno = errno;
  errno = 0;

  const int character = fgetc(stream->handle);
  if(character == EOF && errno != 0 && errno != EBADF)
  {
    dieErrno("failed to check for remaining bytes in \"%s\"",
             internalFDestroy(stream));
  }
  errno = old_errno;

  if(ungetc(character, stream->handle) != character)
  {
    die("failed to check for remaining bytes in \"%s\"",
        internalFDestroy(stream));
  }

  return character != EOF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0xc(%rbp)
callq 0x2050
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x2190
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0xc475
callq 0x2050
cmpl $0x0, (%rax)
je 0xc475
callq 0x2050
cmpl $0x9, (%rax)
je 0xc475
movq -0x8(%rbp), %rdi
callq 0xbe40
movq %rax, %rsi
leaq 0x1876d(%rip), %rdi     # 0x24bdb
movb $0x0, %al
callq 0x4760
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
callq 0x2050
movl -0x14(%rbp), %ecx
movl %ecx, (%rax)
movl -0x10(%rbp), %edi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x22c0
cmpl -0x10(%rbp), %eax
je 0xc4b4
movq -0x8(%rbp), %rdi
callq 0xbe40
movq %rax, %rsi
leaq 0x1872e(%rip), %rdi     # 0x24bdb
movb $0x0, %al
callq 0x4680
cmpl $-0x1, -0x10(%rbp)
setne %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sPathExists
bool sPathExists(StringView path)
{
  const int old_errno = errno;
  bool exists = true;
  struct stat stats;
  errno = 0;

  if(lstat(nullTerminate(path), &stats) != 0)
  {
    if(errno != 0 && errno != ENOENT)
    {
      dieErrno("failed to check existence of \"" PRI_STR "\"",
               STR_FMT(path));
    }

    exists = false;
  }

  errno = old_errno;
  return exists;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movb $0x1, -0x5(%rbp)
callq 0x2050
movq %rax, %rcx
movq -0xa0(%rbp), %rax
movl $0x0, (%rcx)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
leaq -0x98(%rbp), %rsi
callq 0x23c0
cmpl $0x0, %eax
je 0xc571
callq 0x2050
cmpl $0x0, (%rax)
je 0xc56d
callq 0x2050
cmpl $0x2, (%rax)
je 0xc56d
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x186a1(%rip), %rdi     # 0x24c07
movb $0x0, %al
callq 0x4760
movb $0x0, -0x5(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xa4(%rbp)
callq 0x2050
movl -0xa4(%rbp), %ecx
movl %ecx, (%rax)
movb -0x5(%rbp), %al
andb $0x1, %al
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sSymlinkReadTarget
StringView sSymlinkReadTarget(StringView path, Allocator *a)
{
  const struct stat stats = sLStat(path);

  const uint64_t buffer_length = sUint64Add(stats.st_size, 1);
  if(buffer_length > SIZE_MAX)
  {
    die("symlink does not fit in memory: \"" PRI_STR "\"", STR_FMT(path));
  }
  else if(buffer_length > SSIZE_MAX)
  {
    /* In this case the behaviour of readlink() is implementation
       dependent and not portable. */
    die("symlink is too large: \"" PRI_STR "\"", STR_FMT(path));
  }

  char *buffer = allocate(a, buffer_length);

  /* Although st_size bytes are enough to store the symlinks target path,
     the full buffer is used. This allows to detect whether the symlink
     has increased in size while reading. */
  const ssize_t read_bytes =
    readlink(nullTerminate(path), buffer, buffer_length);
  if(read_bytes == -1)
  {
    dieErrno("failed to read symlink: \"" PRI_STR "\"", STR_FMT(path));
  }
  else if(read_bytes != stats.st_size)
  {
    die("symlink changed while reading: \"" PRI_STR "\"", STR_FMT(path));
  }
  buffer[read_bytes] = '\0';

  return str(buffer);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0xc8(%rbp)
movq %rdi, -0xc0(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq %rsi, -0x8(%rbp)
leaq -0x98(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc670
movq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0xb990
movq %rax, -0xa0(%rbp)
cmpq $-0x1, -0xa0(%rbp)
jbe 0xc89a
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x183dc(%rip), %rdi     # 0x24c6f
movb $0x0, %al
callq 0x4680
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rax, -0xa0(%rbp)
jbe 0xc8cb
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x183d2(%rip), %rdi     # 0x24c96
movb $0x0, %al
callq 0x4680
jmp 0xc8cd
movq -0x8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x24c0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0xa8(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
callq 0x20b0
movq %rax, -0xb0(%rbp)
cmpq $-0x1, -0xb0(%rbp)
jne 0xc951
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x18369(%rip), %rdi     # 0x24cb3
movb $0x0, %al
callq 0x4760
movq -0xb0(%rbp), %rax
cmpq -0x68(%rbp), %rax
je 0xc97c
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x176e6(%rip), %rdi     # 0x2405b
movb $0x0, %al
callq 0x4680
jmp 0xc97e
movq -0xc8(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq -0xb0(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0xa8(%rbp), %rsi
callq 0xf100
movq -0xc0(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sUtime
void sUtime(StringView path, const time_t time)
{
  const struct utimbuf time_buffer = {
    .actime = time,
    .modtime = time,
  };

  if(utime(nullTerminate(path), &time_buffer) != 0)
  {
    dieErrno("failed to set timestamp of \"" PRI_STR "\"", STR_FMT(path));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x10(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
leaq -0x18(%rbp), %rsi
callq 0x2030
cmpl $0x0, %eax
je 0xcc1e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x18125(%rip), %rdi     # 0x24d3c
movb $0x0, %al
callq 0x4760
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sRemove
void sRemove(StringView path)
{
  const int old_errno = errno;
  if(remove(nullTerminate(path)) != 0)
  {
    dieErrno("failed to remove \"" PRI_STR "\"", STR_FMT(path));
  }
  errno = old_errno;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
callq 0x2050
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x4(%rbp)
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xbc50
movq %rax, %rdi
callq 0x2070
cmpl $0x0, %eax
je 0xcc97
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movl %ecx, %esi
movq (%rax), %rdx
leaq 0x180ce(%rip), %rdi     # 0x24d5e
movb $0x0, %al
callq 0x4760
movl -0x4(%rbp), %eax
movl %eax, -0x14(%rbp)
callq 0x2050
movl -0x14(%rbp), %ecx
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: removeRecursivelyIf
static bool removeRecursivelyIf(StringView path,
                                ShouldRemoveCallback should_remove,
                                void *user_data)
{
  bool current_path_is_needed = false;

  const struct stat stats = sLStat(path);
  if(S_ISDIR(stats.st_mode))
  {
    DirIterator *dir = sDirOpen(path);
    for(StringView subpath = sDirGetNext(dir); !strIsEmpty(subpath);
        strSet(&subpath, sDirGetNext(dir)))
    {
      if(!removeRecursivelyIf(subpath, should_remove, user_data))
      {
        current_path_is_needed = true;
      }
    }
    sDirClose(dir);
  }

  if(!current_path_is_needed && should_remove(path, &stats, user_data))
  {
    sRemove(path);
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
leaq 0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
leaq -0xb0(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xc670
movl -0x98(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0xcea0
movq -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 0xc0f0
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0xc220
leaq -0xd0(%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 0xce19
jmp 0xce94
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0xd0(%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 0xcd50
testb $0x1, %al
jne 0xce4e
movb $0x1, -0x19(%rbp)
jmp 0xce50
movq -0xb8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0xc220
leaq -0xd0(%rbp), %rdi
leaq -0xe8(%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 0xcdec
movq -0xb8(%rbp), %rdi
callq 0xc3a0
testb $0x1, -0x19(%rbp)
jne 0xcf08
movq -0xf0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
callq *%rax
testb $0x1, %al
jne 0xcedd
jmp 0xcf08
movq -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 0xcc30
movb $0x1, -0x1(%rbp)
jmp 0xcf0c
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sGetCurrentDir
StringView sGetCurrentDir(Allocator *a)
{
  const int old_errno = errno;
  size_t capacity = 4;
  char *buffer = allocate(getTemporaryBuffer(false), capacity);

  while(true)
  {
    errno = 0;
    if(getcwd(buffer, capacity) != NULL)
    {
      errno = old_errno;
      return strCopy(str(buffer), a);
    }
    if(errno != ERANGE)
    {
      dieErrno("failed to determine current working directory");
    }

    capacity = sSizeMul(capacity, 2);
    buffer = allocate(getTemporaryBuffer(false), capacity);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, -0x40(%rbp)
movq %rsi, -0x8(%rbp)
callq 0x2050
movl (%rax), %eax
movl %eax, -0xc(%rbp)
movq $0x4, -0x18(%rbp)
xorl %edi, %edi
callq 0xd020
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x24c0
movq %rax, -0x20(%rbp)
callq 0x2050
movl $0x0, (%rax)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2180
cmpq $0x0, %rax
je 0xcfcc
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
callq 0x2050
movl -0x4c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0xf100
movq -0x48(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x38(%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 -0x40(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
callq 0x2050
cmpl $0x22, (%rax)
je 0xcfe4
leaq 0x17d99(%rip), %rdi     # 0x24d76
movb $0x0, %al
callq 0x4760
movq -0x18(%rbp), %rdi
movl $0x2, %esi
callq 0xb930
movq %rax, -0x18(%rbp)
xorl %edi, %edi
callq 0xd020
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x24c0
movq %rax, -0x20(%rbp)
jmp 0xcf5d
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: getTemporaryBuffer
static Allocator *getTemporaryBuffer(const bool secondary)
{
  static Allocator *buffer[2] = { NULL, NULL };
  if(buffer[secondary] == NULL)
  {
    buffer[secondary] =
      allocatorWrapOneSingleGrowableBuffer(CR_GetGlobalRegion());
  }
  return buffer[secondary];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x1c27f(%rip), %rax     # 0x292c0
cmpq $0x0, (%rax,%rcx,8)
jne 0xd06d
callq 0x22b90
movq %rax, %rdi
callq 0x25e0
movq %rax, %rdx
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x1c257(%rip), %rax     # 0x292c0
movq %rdx, (%rax,%rcx,8)
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, %ecx
leaq 0x1c242(%rip), %rax     # 0x292c0
movq (%rax,%rcx,8), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)