LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
movl %r8d, %ecx
callq 0x848c
cmpl $0x3, (%r12)
jne 0x7f97
movl $0x1fe, %eax            # imm = 0x1FE
andl 0x18(%r15), %eax
addl $-0xe, %eax
cmpl $-0xc, %eax
setb %al
movq 0x28(%r15), %r15
testq %r15, %r15
je 0x7f97
andb %bpl, %al
movzbl %al, %ebp
movq 0x20(%r15), %rdx
cmpl $0x3, 0x1c(%r15)
jne 0x7f73
testq %rdx, %rdx
je 0x7f8e
movq (%rdx), %rax
cmpq %rbx, (%rax)
jae 0x7f73
movq 0x48(%rdx), %rdx
jmp 0x7f60
cmpl $0x0, 0x8(%rdx)
je 0x7f8e
addq $0x8, %rdx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rcx
movl %ebp, %r8d
callq 0x7f0e
movq 0x30(%r15), %r15
testq %r15, %r15
jne 0x7f55
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/restore.c
// Function: initiateRestoreRecursively
static void initiateRestoreRecursively(AllocatorPair *allocator_pair,
                                       PathNode *node_list,
                                       const size_t id, StringView path,
                                       const bool could_exist)
{
  bool found_node = false;

  for(PathNode *node = node_list; node != NULL && found_node == false;
      node = node->next)
  {
    if(strIsEqual(node->path, path))
    {
      found_node = true;
      const PathState *state = findExistingPathState(node, id);
      checkAndHandleChangesRecursively(allocator_pair, node, state, id,
                                       could_exist);
    }
    else if(strIsParentPath(node->path, path))
    {
      found_node = true;

      const PathState *state = findExistingPathState(node, id);
      if(state->type != PST_directory)
      {
        die("path was not a directory at the specified time: \"" PRI_STR
            "\"",
            STR_FMT(node->path));
      }

      checkAndHandleChanges(allocator_pair, node, state, could_exist);

      const bool subnode_could_exist = could_exist &&
        !(backupHintNoPol(node->hint) >= BH_added &&
          backupHintNoPol(node->hint) <= BH_other_to_directory);

      initiateRestoreRecursively(allocator_pair, node->subnodes, id, path,
                                 subnode_could_exist);
    }
  }

  if(!found_node)
  {
    die("path doesn't exist in repository: \"" PRI_STR "\"",
        STR_FMT(path));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x80(%rsp), %r12
movl $0x1fe, %r13d           # imm = 0x1FE
testq %r14, %r14
je 0x80cb
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0xad56
testb %al, %al
jne 0x8099
movq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0xaebe
testb %al, %al
jne 0x8036
movq 0x30(%r14), %r14
jmp 0x7fc7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8630
cmpl $0x3, (%rax)
jne 0x80e2
movzbl %bpl, %ebp
movl %ebp, %ecx
andl $0x1, %ecx
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x848c
testb $0x1, %bpl
je 0x807a
movl 0x18(%r14), %eax
andl %r13d, %eax
addl $-0xe, %eax
cmpl $-0xc, %eax
setb %bpl
jmp 0x807c
xorl %ebp, %ebp
movq 0x28(%r14), %r14
movq 0x10(%r12), %rax
movq %rax, 0x40(%rsp)
movups (%r12), %xmm0
movaps %xmm0, 0x30(%rsp)
jmp 0x7fc7
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8630
movzbl %bpl, %r8d
andl $0x1, %r8d
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
movq %rbx, %rcx
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7f0e
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x68e1(%rip), %rdi      # 0xe9bc
xorl %eax, %eax
callq 0x3ca8
movl 0x8(%r14), %esi
movq (%r14), %rdx
leaq 0x6895(%rip), %rdi      # 0xe985
jmp 0x80db
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rdi, %rbx
leaq 0x1070(%rsp), %r15
cmpq $0x15, 0x10(%rdi)
jb 0x81ca
leaq 0x1088(%rsp), %rax
movq 0x10(%r15), %rcx
movq %rcx, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movups (%rax), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x7698
movq %rax, %r14
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x8979
movq %rax, %r15
movq 0x10(%rbx), %r13
testq %r13, %r13
je 0x81a8
movl $0x1000, %ebp           # imm = 0x1000
leaq 0x30(%rsp), %rbx
cmpq %rbp, %r13
movl $0x1000, %r12d          # imm = 0x1000
cmovbq %r13, %r12
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x7752
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x8abe
subq %r12, %r13
jne 0x817a
movq %r14, %rdi
callq 0x780b
movq %r15, %rdi
callq 0x8bc9
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
callq 0x8979
movq %rax, %r14
movq 0x10(%rbx), %rsi
addq $0x18, %rbx
movq %rbx, %rdi
movq %rax, %rdx
callq 0x8abe
movq %r14, %rdi
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8bc9
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
movq %rsi, %rbx
testl %ecx, %ecx
je 0x84e3
movq %rdx, %r15
movq %rdi, %r14
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x8ed6
testb %al, %al
je 0x84e3
cmpl $0x2, (%r15)
jne 0x84fe
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0x8fc6
jmp 0x851b
movl $0xfffffe00, %eax       # imm = 0xFFFFFE00
andl 0x18(%rbx), %eax
orl $0x2, %eax
movl %eax, 0x18(%rbx)
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x90(%rsp), %rdi
callq 0x8f5d
movl (%r15), %ecx
movl 0xa8(%rsp), %eax
cmpl $0x3, %ecx
je 0x857e
cmpl $0x2, %ecx
je 0x855d
cmpl $0x1, %ecx
jne 0x85d4
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
je 0x85b4
cmpl $0x8000, %eax           # imm = 0x8000
je 0x85d4
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x85c2
movl $0x9, %eax
jmp 0x85c7
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
je 0x85d4
cmpl $0x8000, %eax           # imm = 0x8000
je 0x859f
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x85ad
movl $0xa, %eax
jmp 0x85c7
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
je 0x85d4
cmpl $0x8000, %eax           # imm = 0x8000
je 0x85a6
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x85bb
movl $0x8, %eax
jmp 0x85c7
movl $0x5, %eax
jmp 0x85c7
movl $0x6, %eax
jmp 0x85c7
movl $0xc, %eax
jmp 0x85c7
movl $0x7, %eax
jmp 0x85c7
movl $0xd, %eax
jmp 0x85c7
movl $0xb, %eax
movl $0xfffffe00, %ecx       # imm = 0xFFFFFE00
andl 0x18(%rbx), %ecx
orl %eax, %ecx
movl %ecx, 0x18(%rbx)
movzwl 0x18(%rbx), %eax
testl $0x1ff, %eax            # imm = 0x1FF
jne 0x84f1
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups 0x30(%r15), %xmm3
leaq 0x120(%rsp), %rdx
movaps %xmm3, 0x30(%rdx)
movaps %xmm2, 0x20(%rdx)
movaps %xmm1, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x90(%rsp), %rsi
movl $0x12, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2880
jmp 0x84f1
// File: /workspace/github_c_makefile_star2_O3/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 %rax
movq 0x20(%rdi), %rax
cmpl $0x3, 0x1c(%rdi)
jne 0x864e
testq %rax, %rax
je 0x865a
movq (%rax), %rcx
cmpq %rsi, (%rcx)
jae 0x864e
movq 0x48(%rax), %rax
jmp 0x863b
cmpl $0x0, 0x8(%rax)
je 0x865a
addq $0x8, %rax
popq %rcx
retq
movl 0x8(%rdi), %esi
movq (%rdi), %rdx
leaq 0x637e(%rip), %rdi      # 0xe9e5
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/restore.c
// Function: restorePath
static void restorePath(const PathNode *node, const PathState *state,
                        StringView repo_path)
{
  if(state->type == PST_regular_file)
  {
    restoreFile(node->path, &state->metadata.file_info, repo_path);
    sChown(node->path, state->uid, state->gid);
    sChmod(node->path, state->metadata.file_info.permission_bits);
    sUtime(node->path, state->metadata.file_info.modification_time);
  }
  else if(state->type == PST_symlink)
  {
    sSymlink(state->metadata.symlink_target, node->path);
    sLChown(node->path, state->uid, state->gid);
  }
  else if(state->type == PST_directory)
  {
    sMkdir(node->path);
    sChown(node->path, state->uid, state->gid);
    sChmod(node->path, state->metadata.directory_info.permission_bits);
    sUtime(node->path, state->metadata.directory_info.modification_time);
  }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl (%rsi), %eax
cmpl $0x3, %eax
je 0x870c
cmpl $0x2, %eax
je 0x86c5
cmpl $0x1, %eax
jne 0x8770
leaq 0x50(%rsp), %rax
leaq 0x10(%r14), %rdi
movq 0x10(%rax), %rcx
movq %rcx, 0x28(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x80f2
jmp 0x8721
movq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x20(%r14), %rax
movq %rax, 0x10(%rsp)
movups 0x10(%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x9084
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x933a
jmp 0x8770
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x902f
movl 0x4(%r14), %edi
movl 0x8(%r14), %esi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x92de
movl 0x10(%r14), %edi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x9288
movq 0x18(%r14), %rdi
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x9396
addq $0x38, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x40, %rsp
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x88da
movq %rax, %rbx
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %edi, %edi
callq 0x96bf
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
leaq 0x5f77(%rip), %rsi      # 0xe807
movq %rax, %rdi
callq 0x2370
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
testq %rax, %rax
je 0x88bc
leaq 0xa7(%rip), %rsi        # 0x8952
movq %rbx, %rdx
callq 0xda39
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
leaq 0x50(%rsp), %rbx
callq 0xda8a
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x61b6(%rip), %rdi      # 0xea89
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
callq 0xd89c
movq %rax, %rbx
movl $0x28, %esi
movq %rax, %rdi
callq 0xd960
movq %rax, %r14
movq %rbx, (%rax)
leaq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x2828
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0xac37
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xac25
movq %r14, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq 0x20(%rdi), %rbx
testq %rbx, %rbx
je 0x8974
callq 0x2060
movq %rax, %r14
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x2100
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x40, %rsp
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x88da
movq %rax, %rbx
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rsp)
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %edi, %edi
callq 0x96bf
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
leaq 0x60d5(%rip), %rsi      # 0xeaab
movq %rax, %rdi
callq 0x2370
movq %rax, 0x20(%rbx)
movq (%rbx), %rdi
testq %rax, %rax
je 0x8a02
leaq -0x9f(%rip), %rsi       # 0x8952
movq %rbx, %rdx
callq 0xda39
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
retq
leaq 0x50(%rsp), %rbx
callq 0xda8a
movl 0x8(%rbx), %esi
movq (%rbx), %rdx
leaq 0x6095(%rip), %rdi      # 0xeaae
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq 0x20(%rdx), %rcx
movl $0x1, %esi
movq %r14, %rdx
callq 0x20c0
cmpq %r14, %rax
jne 0x8a45
popq %rbx
popq %r14
popq %rbp
retq
movq 0x20(%rbx), %rdi
callq 0x2260
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8a7e
testl %ebp, %ebp
jne 0x8a6d
leaq 0x609c(%rip), %rdi      # 0xeaff
movq %rax, %rsi
xorl %eax, %eax
callq 0x3d70
leaq 0x605c(%rip), %rdi      # 0xead0
movq %rax, %rsi
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
xorl %edi, %edi
callq 0x96bf
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2360
cmpl $-0x1, %eax
je 0x8bb0
movl %eax, %ebx
movl %eax, %edi
callq 0x2070
testl %eax, %eax
jne 0x8bb0
movl %ebx, %edi
callq 0x21c0
testl %eax, %eax
jne 0x8bb0
addq $0x20, %rsp
popq %rbx
retq
leaq 0x30(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x5f71(%rip), %rdi      # 0xeb33
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq 0x20(%rdi), %r14
movq $0x0, 0x20(%rdi)
callq 0x8a7e
movq %rax, %rbx
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
jne 0x8bf5
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5f5d(%rip), %rdi      # 0xeb59
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r14
pushq %rbx
movq 0x28(%rdi), %rbx
testq %rbx, %rbx
je 0x8c2d
callq 0x2060
movq %rax, %r14
movl (%rax), %ebp
movq %rbx, %rdi
callq 0x21d0
movl %ebp, (%r14)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
callq 0xd89c
movq %rax, %rbx
movl $0x30, %esi
movq %rax, %rdi
callq 0xd960
movq %rax, %r14
movq %rbx, (%rax)
leaq 0x8(%rax), %r15
movq %rbx, %rdi
callq 0x2828
movq 0x90(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0xac37
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xac25
movq %rbx, %rdi
callq 0x2842
movq %rax, 0x20(%r14)
movq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
movaps 0x80(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
xorl %edi, %edi
callq 0x96bf
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %rdi
callq 0x2110
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x8d22
leaq -0xfd(%rip), %rsi       # 0x8c0b
movq %rbx, %rdi
movq %r14, %rdx
callq 0xda39
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x80(%rsp), %r14
movq %rbx, %rdi
callq 0xda8a
movl 0x8(%r14), %esi
movq (%r14), %rdx
leaq 0x5e2e(%rip), %rdi      # 0xeb6e
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2060
movq %rax, %r15
movl (%rax), %ebp
movl $0x0, (%rax)
movq 0x28(%r14), %rdi
callq 0x22c0
testq %rax, %rax
je 0x8dd7
cmpb $0x2e, 0x13(%rax)
jne 0x8d8e
movzbl 0x14(%rax), %ecx
testl %ecx, %ecx
je 0x8d67
cmpl $0x2e, %ecx
jne 0x8d8e
cmpb $0x0, 0x15(%rax)
je 0x8d67
addq $0x13, %rax
movl %ebp, (%r15)
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0xab5c
movq 0x20(%r14), %rsi
movq 0x10(%r15), %rax
movq %rax, 0x28(%rsp)
movups (%r15), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x18(%r14), %rax
movq %rax, 0x10(%rsp)
movups 0x8(%r14), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xaf03
jmp 0x8def
cmpl $0x0, (%r15)
jne 0x8dfd
movl %ebp, (%r15)
leaq 0x59b8(%rip), %rsi      # 0xe79f
movq %rbx, %rdi
callq 0xab5c
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x10(%r14), %esi
movq 0x8(%r14), %rdx
leaq 0x5d82(%rip), %rdi      # 0xeb8e
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movq $0x0, 0x28(%rbx)
callq 0x21d0
testl %eax, %eax
jne 0x8e35
movq (%rbx), %rdi
popq %rbx
jmp 0xda8a
movl 0x10(%rbx), %esi
movq 0x8(%rbx), %rdx
leaq 0x5d6b(%rip), %rdi      # 0xebae
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2060
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq 0x20(%rbx), %rdi
callq 0x21b0
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x8e81
movl (%r14), %eax
testl %eax, %eax
je 0x8e81
cmpl $0x9, %eax
jne 0x8ebd
movl %r15d, (%r14)
movq 0x20(%rbx), %rsi
movl %ebp, %edi
callq 0x22f0
cmpl %ebp, %eax
jne 0x8ea4
cmpl $-0x1, %ebp
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x8a7e
leaq 0x5d1c(%rip), %rdi      # 0xebcf
movq %rax, %rsi
xorl %eax, %eax
callq 0x3ca8
movq %rbx, %rdi
callq 0x8a7e
leaq 0x5d03(%rip), %rdi      # 0xebcf
movq %rax, %rsi
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0xa8, %rsp
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
xorl %edi, %edi
callq 0x96bf
movq 0xd0(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0xc0(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
callq 0x2210
testl %eax, %eax
je 0x8f30
testl $0xfffffffd, (%rbx)     # imm = 0xFFFFFFFD
jne 0x8f41
testl %eax, %eax
sete %al
movl %ebp, (%rbx)
addq $0xa8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xc0(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x5ca5(%rip), %rdi      # 0xebfb
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xe0(%rsp), %r13
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movaps (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x8fc6
movq 0x30(%r14), %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0x87b4
testq %rax, %rax
js 0x91c3
movq %rax, %r12
movq %r15, %rdi
movq %rax, %rsi
callq 0x27ac
movq %rax, %r15
xorl %edi, %edi
callq 0x96bf
movq 0x10(%r13), %rcx
movq %rcx, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x20d0
cmpq $-0x1, %rax
je 0x91d4
cmpq %r14, %rax
jne 0x91ea
movb $0x0, (%r15,%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0xab5c
movq %rbx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl 0x8(%r13), %esi
movq (%r13), %rdx
leaq 0x5a91(%rip), %rdi      # 0xec63
jmp 0x91f9
movl 0x8(%r13), %esi
movq (%r13), %rdx
leaq 0x5a9d(%rip), %rdi      # 0xec80
xorl %eax, %eax
callq 0x3d70
movl 0x8(%r13), %esi
movq (%r13), %rdx
leaq 0x4e52(%rip), %rdi      # 0xe04b
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x30, %rsp
leaq 0x20(%rsp), %rbx
movq %rdi, (%rbx)
movq %rdi, 0x8(%rbx)
xorl %edi, %edi
callq 0x96bf
movq 0x50(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2030
testl %eax, %eax
jne 0x93de
addq $0x30, %rsp
popq %rbx
retq
leaq 0x40(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x5919(%rip), %rdi      # 0xed09
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x18, %rsp
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
xorl %edi, %edi
callq 0x96bf
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %rdi
callq 0x2080
testl %eax, %eax
jne 0x943e
movl %ebp, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x30(%rsp), %rax
movl 0x8(%rax), %esi
movq (%rax), %rdx
leaq 0x58db(%rip), %rdi      # 0xed2b
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x110(%rsp), %r13
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movaps (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x8fc6
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%r15), %eax
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x9593
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
callq 0x8c32
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %rax, %rsi
callq 0x8d47
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0xad4c
testb %al, %al
je 0x950c
movq %r15, %rdi
callq 0x8e13
jmp 0x9593
xorl %ebp, %ebp
leaq 0x30(%rsp), %r12
leaq 0x18(%rsp), %r13
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9467
xorb $0x1, %al
orb %al, %bpl
movq %r12, %rdi
movq %r15, %rsi
callq 0x8d47
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0xac25
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0xad4c
testb %al, %al
je 0x9518
movq %r15, %rdi
callq 0x8e13
testb $0x1, %bpl
leaq 0x110(%rsp), %r13
jne 0x95ce
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %rdi
movq %r14, %rsi
callq *%rbx
testb %al, %al
je 0x95ce
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
callq 0x93f7
movb $0x1, %al
jmp 0x95d0
xorl %eax, %eax
addq $0xd8, %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/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x2060
movq %rax, %r15
movl (%rax), %ebp
xorl %edi, %edi
callq 0x96bf
movl $0x4, %r12d
movl $0x4, %esi
movq %rax, %rdi
callq 0x27ac
movq %rax, %r13
movl $0x0, (%r15)
movl $0x4, %esi
movq %rax, %rdi
callq 0x21a0
testq %rax, %rax
jne 0x9670
cmpl $0x22, (%r15)
jne 0x96b1
movl $0x2, %esi
movq %r12, %rdi
callq 0x8790
movq %rax, %r12
xorl %edi, %edi
callq 0x96bf
movq %rax, %rdi
movq %r12, %rsi
callq 0x27ac
movq %rax, %r13
movl $0x0, (%r15)
movq %rax, %rdi
movq %r12, %rsi
jmp 0x962c
movl %ebp, (%r15)
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0xab5c
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xac37
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x568b(%rip), %rdi      # 0xed43
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x9ba4(%rip), %r14      # 0x13270
movq (%r14,%rbx,8), %rax
testq %rax, %rax
jne 0x96e6
callq 0xd6dc
movq %rax, %rdi
callq 0x2842
movq %rax, (%r14,%rbx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sReadLine
bool sReadLine(FILE *stream, Allocator *a, StringView *result_out)
{
  const int old_errno = errno;

  size_t capacity = 4; /* Small value to test growth. */
  char *buffer = allocate(getTemporaryBuffer(false), capacity);
  size_t length_used = 0;

  while(true)
  {
    errno = 0;
    const int character = fgetc(stream);
    if(character == EOF)
    {
      if(errno != 0) dieErrno("failed to read line");

      if(length_used == 0)
      {
        strSet(result_out, str(""));
        errno = old_errno;
        return false;
      }
    }
    if(character == EOF || character == '\n' || character == '\r' ||
       character == '\0')
    {
      strSet(result_out, strCopy(strUnterminated(buffer, length_used), a));
      errno = old_errno;
      return true;
    }

    buffer[length_used] = (char)character;
    length_used++;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r15
movq %rdi, %r13
callq 0x2060
movq %rax, %r14
movl (%rax), %eax
movl %eax, 0x24(%rsp)
movl $0x4, %ebp
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x96bf
movq %rax, %rdi
movq %rbp, %rsi
callq 0x27ac
movq %rax, %rbx
movl $0x0, (%r14)
movq %r13, %rdi
callq 0x21b0
cmpl $0x9, %eax
jg 0x9751
cmpl $-0x1, %eax
je 0x9779
testl %eax, %eax
jne 0x975b
jmp 0x9788
cmpl $0xa, %eax
je 0x9788
cmpl $0xd, %eax
je 0x9788
movb %al, (%rbx,%r12)
incq %r12
cmpq %r12, %rbp
jne 0x9732
movl $0x2, %esi
movq %rbp, %rdi
callq 0x8790
movq %rax, %rbp
jmp 0x971d
cmpl $0x0, (%r14)
jne 0x980a
testq %r12, %r12
je 0x97f2
leaq 0x30(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0xab78
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xac37
movb $0x1, %bpl
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movq 0x28(%rsp), %rdi
callq 0xac25
movl 0x24(%rsp), %eax
movl %eax, (%r14)
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4fa6(%rip), %rsi      # 0xe79f
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0xab5c
xorl %ebp, %ebp
jmp 0x97c0
leaq 0x5560(%rip), %rdi      # 0xed71
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sIsTTY
bool sIsTTY(FILE *stream)
{
  const int descriptor = fileno(stream);
  if(descriptor == -1)
  {
    dieErrno("failed to get file descriptor from stream");
  }

  const int old_errno = errno;
  const int is_tty = isatty(descriptor);
  errno = old_errno;

  return is_tty == 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
callq 0x22b0
cmpl $-0x1, %eax
je 0x9847
movl %eax, %ebx
callq 0x2060
movq %rax, %r14
movl (%rax), %ebp
movl %ebx, %edi
callq 0x20b0
movl %ebp, (%r14)
cmpl $0x1, %eax
sete %al
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x5537(%rip), %rdi      # 0xed85
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sStringToSize
size_t sStringToSize(StringView string)
{
  const int old_errno = errno;
  errno = 0;

  const char *raw_string = nullTerminate(string);
  char *endptr;
  const long long int value = strtoll(raw_string, &endptr, 10);

  if(endptr == raw_string)
  {
    die("unable to convert to size: \"%s\"", raw_string);
  }
  else if(value < 0)
  {
    die("unable to convert negative value to size: \"%s\"", raw_string);
  }
  else if((value == LLONG_MAX && errno == ERANGE) ||
          (unsigned long long int)value > SIZE_MAX)
  {
    die("value too large to convert to size: \"%s\"", raw_string);
  }

  errno = old_errno;
  return (size_t)value;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
callq 0x2060
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
xorl %edi, %edi
callq 0x96bf
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %rax, %r14
leaq 0x20(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2240
cmpq %r14, (%r15)
je 0x98d4
testq %rax, %rax
js 0x98dd
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, %rax
jne 0x98c7
cmpl $0x22, (%rbx)
je 0x98e6
movl %ebp, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54d4(%rip), %rdi      # 0xedaf
jmp 0x98ed
leaq 0x54eb(%rip), %rdi      # 0xedcf
jmp 0x98ed
leaq 0x5511(%rip), %rdi      # 0xedfe
movq %r14, %rsi
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sTime
time_t sTime(void)
{
  const time_t current_time = time(NULL);

  if(current_time == (time_t)-1)
  {
    die("failed to determine current time");
  }

  return current_time;
}

// Assembly:
pushq %rax
xorl %edi, %edi
callq 0x22a0
cmpq $-0x1, %rax
je 0x9907
popq %rcx
retq
leaq 0x5519(%rip), %rdi      # 0xee27
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sTimeMilliseconds
uint64_t sTimeMilliseconds(void)
{
  struct timespec timespec;
  if(clock_gettime(CLOCK_REALTIME, &timespec) == -1)
  {
    dieErrno("failed to determine current time");
  }

  return sUint64Add(sUint64Mul(timespec.tv_sec, 1000),
                    timespec.tv_nsec / 1000000);
}

// Assembly:
subq $0x18, %rsp
leaq 0x8(%rsp), %rsi
xorl %edi, %edi
callq 0x20e0
cmpl $-0x1, %eax
je 0x9963
movq 0x8(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x87cc
movq %rax, %rdi
movabsq $0x431bde82d7b634db, %rax # imm = 0x431BDE82D7B634DB
imulq 0x10(%rsp)
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
callq 0x87b4
addq $0x18, %rsp
retq
leaq 0x54bd(%rip), %rdi      # 0xee27
xorl %eax, %eax
callq 0x3d70
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sRand
int sRand(void)
{
  static bool already_seeded = false;

  if(!already_seeded)
  {
    srand((sTime() << 9) + getpid());
    already_seeded = true;
  }

  return rand();
}

// Assembly:
cmpb $0x0, 0x98e8(%rip)      # 0x13260
jne 0x23f0
pushq %rbx
callq 0x98f7
movq %rax, %rbx
callq 0x20f0
shll $0x9, %ebx
addl %eax, %ebx
movl %ebx, %edi
callq 0x2220
movb $0x1, 0x98c1(%rip)      # 0x13260
popq %rbx
jmp 0x23f0
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sGetFilesContent
FileContent sGetFilesContent(CR_Region *region, StringView path)
{
  const struct stat file_stats = sStat(path);
  if(!S_ISREG(file_stats.st_mode))
  {
    die("\"" PRI_STR "\" is not a regular file", STR_FMT(path));
  }

  /* On 32-bit systems off_t is often larger than size_t. */
  if((uint64_t)file_stats.st_size > SIZE_MAX)
  {
    die("unable to load file into mem due to its size: \"" PRI_STR "\"",
        STR_FMT(path));
  }

  if(file_stats.st_size > 0)
  {
    FileStream *stream = sFopenRead(path);
    char *content = CR_RegionAllocUnaligned(region, file_stats.st_size);
    sFread(content, file_stats.st_size, stream);
    const bool stream_not_at_end = sFbytesLeft(stream);
    sFclose(stream);

    if(stream_not_at_end)
    {
      die("file changed while reading: \"" PRI_STR "\"", STR_FMT(path));
    }

    return (FileContent){ .content = content, .size = file_stats.st_size };
  }

  char *content = CR_RegionAllocUnaligned(region, 1);
  content[0] = '\0';

  return (FileContent){ .content = content, .size = 0 };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdi, %r14
leaq 0xe0(%rsp), %r12
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movaps (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x8f5d
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x9a87
movq 0x50(%rsp), %rbx
testq %rbx, %rbx
jle 0x9a5c
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x8833
movq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd980
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x8a20
movq %r15, %rdi
callq 0x8e4a
movl %eax, %ebp
movq %r15, %rdi
callq 0x8bc9
testb %bpl, %bpl
je 0x9a71
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x540b(%rip), %rdi      # 0xee65
jmp 0x9a97
movl $0x1, %esi
movq %r14, %rdi
callq 0xd980
movq %rax, %r14
movb $0x0, (%rax)
xorl %ebx, %ebx
movq %r14, %rax
movq %rbx, %rdx
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%r12), %esi
movq (%r12), %rdx
leaq 0x53b1(%rip), %rdi      # 0xee48
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/safe-wrappers.c
// Function: sRegexCompile
const regex_t *sRegexCompile(CR_Region *r, StringView expression,
                             StringView file_name, const size_t line_nr)
{
  regex_t *regex = CR_RegionAlloc(r, sizeof *regex);
  const int error =
    regcomp(regex, nullTerminate(expression), REG_EXTENDED | REG_NOSUB);

  if(error != 0)
  {
    const size_t error_length = regerror(error, regex, NULL, 0);
    char *error_str = allocate(getTemporaryBuffer(false), error_length);
    regerror(error, regex, error_str, error_length);
    die(PRI_STR ": line %zu: %s: \"" PRI_STR "\"", STR_FMT(file_name),
        line_nr, error_str, STR_FMT(expression));
  }
  CR_RegionAttach(r, releaseRegex, regex);

  return regex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movl $0x40, %esi
callq 0xd960
movq %rax, %r14
xorl %edi, %edi
callq 0x96bf
movq 0x60(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0xab87
movq %r14, %rdi
movq %rax, %rsi
movl $0x9, %edx
callq 0x21e0
testl %eax, %eax
jne 0x9b19
leaq 0x86(%rip), %rsi        # 0x9b82
movq %r15, %rdi
movq %r14, %rdx
callq 0xda39
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ebp
leaq 0x68(%rsp), %r13
movl %eax, %edi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2290
movq %rax, %r15
xorl %edi, %edi
callq 0x96bf
movq %rax, %rdi
movq %r15, %rsi
callq 0x27ac
movq %rax, %r12
movl %ebp, %edi
movq %r14, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x2290
movl 0x8(%r13), %esi
movq (%r13), %rdx
leaq 0x50(%rsp), %rax
movl 0x8(%rax), %r9d
movq (%rax), %rax
movq %rax, (%rsp)
leaq 0x5313(%rip), %rdi      # 0xee88
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x3ca8
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search-tree.c
// Function: inheritPolicyToSubnodes
static void inheritPolicyToSubnodes(SearchNode *parent_node)
{
  for(SearchNode *node = parent_node->subnodes; node != NULL;
      node = node->next)
  {
    if(node->policy == BPOL_none || node->policy_inherited)
    {
      node->policy = parent_node->policy;
      node->policy_inherited = true;
      node->policy_line_nr = parent_node->policy_line_nr;
      inheritPolicyToSubnodes(node);
    }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x40(%rdi), %r14
testq %r14, %r14
je 0xa469
movq %rdi, %rbx
cmpl $0x0, 0x2c(%r14)
je 0xa444
cmpb $0x1, 0x30(%r14)
jne 0xa460
movl 0x2c(%rbx), %eax
movl %eax, 0x2c(%r14)
movb $0x1, 0x30(%r14)
movq 0x38(%rbx), %rax
movq %rax, 0x38(%r14)
movq %r14, %rdi
callq 0xa426
movq 0x60(%r14), %r14
testq %r14, %r14
jne 0xa436
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/AlxHnr[P]nano-backup/src/search-tree.c
// Function: searchTreeLoad
SearchNode *searchTreeLoad(CR_Region *r, StringView path_to_config)
{
  CR_Region *disposable_r = CR_RegionNew();
  const FileContent content =
    sGetFilesContent(disposable_r, path_to_config);
  StringView config = strUnterminated(content.content, content.size);

  SearchNode *root_node = searchTreeParse(r, config);
  CR_RegionRelease(disposable_r);

  return root_node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0xd89c
movq %rax, %r14
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x99a5
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0xab78
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x9bd0
movq %rax, %rbx
movq %r14, %rdi
callq 0xda8a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)