// File: /workspace/github_c_makefile_star2_O0/AlxHnr[P]nano-backup/src/backup.c
// Function: addFileToRepo
static void addFileToRepo(PathNode *node, StringView repo_path,
                          StringView repo_tmp_file_path)
{
  RegularFileInfo *file_info = &node->history->state.metadata.file_info;

  /* Die if the file has changed since the metadata was initiated. */
  const struct stat stats = sStat(node->path);
  if(node->history->state.metadata.file_info.modification_time !=
     stats.st_mtime)
  {
    die("file has changed during backup: \"" PRI_STR "\"",
        STR_FMT(node->path));
  }
  else if(file_info->size > FILE_HASH_SIZE)
  {
    if(!(node->hint & BH_fresh_hash))
    {
      fileHash(node->path, stats, file_info->hash, NULL, NULL);
    }

    if(!searchFileDuplicates(node, repo_path, stats))
    {
      copyFileIntoRepo(node, repo_path, repo_tmp_file_path, stats);
    }
  }
  else if(!(node->hint & BH_fresh_hash))
  {
    /* Store small files directly in its hash buffer. */
    FileStream *stream = sFopenRead(node->path);
    sFread(&file_info->hash, file_info->size, stream);
    const bool stream_not_at_end = sFbytesLeft(stream);
    sFclose(stream);

    if(stream_not_at_end)
    {
      die("file has changed during backup: \"" PRI_STR "\"",
          STR_FMT(node->path));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
leaq 0x28(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x8, %rax
addq $0x10, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
leaq -0xa0(%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 -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rax
cmpq -0x48(%rbp), %rax
je 0x3f33
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq 0x20189(%rip), %rdi     # 0x240b5
movb $0x0, %al
callq 0x4680
movq -0x10(%rbp), %rax
cmpq $0x14, 0x10(%rax)
jbe 0x4059
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x3fb0
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xd0(%rbp)
xorl %eax, %eax
movq %rsp, %rax
movq %rax, %rdi
addq $0x18, %rdi
movl $0x12, %ecx
leaq -0xa0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xd0(%rbp), %rdi
movq -0xc8(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x4860
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq %rsp, %rax
movq %rax, %rdi
addq $0x18, %rdi
movl $0x12, %ecx
leaq -0xa0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xd8(%rbp), %rdi
movq -0xb8(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
callq 0x4110
testb $0x1, %al
jne 0x4054
movq -0xc0(%rbp), %rdx
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq %rsp, %rax
movq %rax, %rdi
addq $0x30, %rdi
movl $0x12, %ecx
leaq -0xa0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xe0(%rbp), %rdi
movq -0xb8(%rbp), %rcx
movq 0x10(%rdx), %rsi
movq %rsi, 0x28(%rax)
movups (%rdx), %xmm0
movups %xmm0, 0x18(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
callq 0x4200
jmp 0x40ff
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
jne 0x40fd
movq -0x8(%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 0xbad0
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0xa8(%rbp), %rdx
callq 0xbdc0
movq -0xa8(%rbp), %rdi
callq 0xc410
andb $0x1, %al
movb %al, -0xa9(%rbp)
movq -0xa8(%rbp), %rdi
callq 0xc020
testb $0x1, -0xa9(%rbp)
je 0x40fb
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rdx
leaq 0x1ffc1(%rip), %rdi     # 0x240b5
movb $0x0, %al
callq 0x4680
jmp 0x40fd
jmp 0x40ff
jmp 0x4101
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw (%rax,%rax)